Mega Code Archive
Categories
/
C++
/
Function
Simple template function to accept two parameters
#include
using namespace std; template
void myFunction(type1 x, type2 y) { cout << x << ' ' << y << endl; } int main() { myFunction(10, "hi"); myFunction(0.23, 10L); return 0; }