Mega Code Archive
Categories
/
C++
/
Function
A Function with Two Generic Types
#include
using namespace std; template
void myfunc(type1 x, type2 y) { cout << x << ' ' << y << '\n'; } int main() { myfunc(10, "I like C++"); myfunc(98.6, 19L); return 0; }