C++ | Templates | Question 10
val = 2*funStruct<n-1>::val;
val = 1 ;
cout << funStruct<10>::val << endl;
(A) Compiler Error
Explanation: This is an example of template metaprogramming. The program mainly calculates 2^10.
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important C++ Foundation and STL concepts with the C++ Foundation and STL courses at a student-friendly price and become industry ready.