Re: Templates compilation
its "template" and not "Template" watch the case.
This works
Code:
#include<iostream.h>
template <class T> T Add(T x,T y)
{
return (x+y);
}
int main()
{
cout<<Add(12,13)<<endl;
return 0;
}
Bharani.
Re: Templates compilation
1. C++ is a case-sensitive language, so it should be 'template' not 'Template'.
2. names in any programming language cannot include space as in 'my function'. it should be myfunction or my_function.
Re: Templates compilation
Quote:
Originally Posted by ajbharani
This works
Not on the compiler that I use or many ANSI standard compiler. The correct standard header is <iostream>, not <iostream.h>
Regards,
Paul McKenzie
Re: Templates compilation