What should be put instead of // 1 for the code to compile and execute successfully? Select all that apply.
enum E { a = 0, b = 1 };
//1
void main()
{
  C<0> c;
  C<a> d = c;  
}
Explanation
enum is converted to int, so template<int> is perfectly valid. The opposite is not true, so an error will occur in template< E > when trying to cast int (namely, number 0) to E.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes