← Back to Question List
C++ Code Walkthrough #84
Deduce a Single Template Type
📄 Code
Read carefully — what does this print?1#include <iostream>2#include <string>34template <typename T>5void printValue(T value) {6 std::cout << value << "\n";7}89int main() {10 printValue(42);11 printValue(2.5);12 printValue('A');13 printValue(std::string("hello"));14 printValue(7);15 printValue(std::string("bye"));16 return 0;17}