← Back to Question List
C++ Code Walkthrough #85
Deduce Two Independent Types
📄 Code
Read carefully — what does this print?1#include <iostream>2#include <string>34template <typename T, typename U>5void showPair(T first, U second) {6 std::cout << first << " " << second << "\n";7}89int main() {10 showPair(3, 4.5);11 showPair('x', 10);12 showPair(std::string("age"), 21);13 showPair(2.5, 1.5);14 showPair(1, 2);15 return 0;16}