Code /* template1.cpp CIS 250 David Klick 2009-02-23 Demonstration of function templating. */ #include #include using std::cin; using std::cout; using std::endl; using std::fixed; void cont(); template T add(T x, T y) { return x + y; } int main() { cout << fixed; cout << add(3, 4) << endl; cout << add(3.0, 4.0) << endl; cout << add('a', (char)2) << endl; cont(); return 0; } void cont() { if (cin.rdbuf()->sungetc() != -1 && cin.get() != '\n') cin.ignore(80,'\n'); cout << "Press enter to continue..."; cin.get(); }