← Back to Question List
C++ Quiz #112
class or typename in the Template Prefix
This template is written with class T instead of typename T, and it is called with an int and then a char. What happens?
📄 Code
1#include <iostream>23template <class T>4void printTwice(T value) {5 std::cout << value << " " << value << "\n";6}78int main() {9 printTwice(4);10 printTwice('a');11 return 0;12}