+ 1
template specialization
template <class T> class MyClass { public: MyClass (T x) { cout <<x<<" - not a char"<<endl;// please tell me that why did we write here x after cout? } };
4 Answers
+ 4
That depends on the purpose. In the code in the Course, it was to print the value and show that x was not of type char.
Then they specialized the class for the char type and printed, 'x' is a char. This was possible, as they wrote a seperate class for the type char.
+ 4
answer is <> and int.
0
The a
nswer is <> and int
- 1
answer is <> and char.
Hot today
What’s wrong?
3 Votes
Question is write a c program to print prime numbers up to n and print the largest number in array.
1 Votes
Question - Java: Pyramid layers
2 Votes
Error in Program
1 Votes
What is next?
0 Votes