Vidyalelo
C++ Programming · Q276

C++ miscellaneous

Programming · C++ Programming · question 276

Q276

What will be the output of the following C++ code? #include using namespace std; template struct funStruct static const int val = 2*funStruct ::val; ; template<> struct funStruct static const int val = 1 ; ; int main() cout ::val << endl; return 0;

A.
1
B.
1024
Answer
C.
Error
D.
Segmentation fault

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board