PDA

View Full Version : templatized function



anon10320
20-03-2013, 03:36 AM
Sir,
When,I was doing the example of slide 11.3 then in case of macros it works fine but when I tried template ,it give some small errors.

576577

Thanks
anon10320

anup
20-03-2013, 05:47 AM
Anon10320,

Why are you not using the Makefile? You missed the gcc -I. option which tells gcc where additionally to look for include files. Due to this it is unable to include the file myapp.h. Secondly, you have using namespace std; much later in the code and are trying to use cout before this statement. You can either write std::cout or put the namespace statement right after your includes.

These are trivial errors and you should try to solve them yourself.

Thanks,

Anup