Using the Template function
Tutorials Shared by the Internet Community
Total Hits - 27034
Total Votes - 100 votes
Vote Up - 43 votes
Vote Down - 57 votes
Domain - forum.codecall.net
Category - C and C++/General Development
Submitted By - Shekhar
Submitted on - 2008-04-16 02:21:23
Function templates act like general templates and are for functions. They can be used with generic types.
In C++ to create a function template we use the template parameters. A template parameter is a special kind of parameter that can be used to pass a type as argument: just like regular function parameters can be used to pass values to a function, template parameters allow to pass types to a function as well. These function templates can use these parameters as if they were any other regular type. ...