defining a function with template after main()prototype should be placed before main like this (on line 3) template<class T> void print(T var); ...