LogiQuest
Back to Templates
7

What will be the output of the program?

#include <iostream>
using namespace std;
template <typename T>
void show(T v) { cout << "T"; }
template <>
void show<int>(int v) { cout << "int"; }
int main() {
    show(1.0);
    show(1);
    cout << endl;
    return 0;
}
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.