← Back to Question List
C++ Quiz #56
Two-Type Template Class Output
What is the output of this code?
``cpp
#include <iostream>
#include <string>
using namespace std;
template <typename K, typename V>
class Entry {
public:
K key;
V value;
Entry(K k, V v) : key(k), value(v) {}
void print() {
cout << key << ": " << value << "\n";
}
};
int main() {
Entry<string, int> e("score", 100);
e.print();
}
``