CJCoding With Joseph
15free / daySign inCreate account
← Back to Question List

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics:
C++ Quiz #119

Three Types in One Function Call

mediumTemplates

This function template has three type parameters and is called as describe(7, 'q', 1.5). What is printed, and what are A, B and C?

📄 Code

1#include <iostream>
2 
3template <typename A, typename B, typename C>
4void describe(A first, B second, C third) {
5 std::cout << first << " | " << second << " | " << third << "\n";
6}
7 
8int main() {
9 describe(7, 'q', 1.5);
10 return 0;
11}