...

View Full Version : Help on template function in C++



Codman
06-23-2008, 02:51 PM
Hi everyone!

Yesterday I was reading my C++ book. There I just came across with the function "template". I got the basic idea as to where to use it but got a bit confused with the syntax which was given over there. Can any one help on this. The syntax was somewhat like this:



template <class T1,class T2,class T3,........>
ReturnType FunctionName (argument1, argument2,.......,argumentN)
{
//Body of the function
}


Please explain me this.

Thanks in advance

eak
06-23-2008, 09:39 PM
This may help you.

http://www.cplusplus.com/doc/tutorial/templates.html

cyberfriend
06-24-2008, 03:08 AM
This also informative content also help you
http://www.codersource.net/cpp_template_function.html
:)

Codman
06-24-2008, 12:51 PM
Thanks eak for the info given by you. It was really helpful to me.

Thanks a lot.

eak
06-30-2008, 03:45 PM
I haven't done CPP since college but it really helped me with my programing in general. I especially liked the data structures class I took.

I sometimes miss the templated classes/functions and class member function overloading that you can do in CPP.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum