[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.
Technical Discussion :: C++

57 / 187

What is a template?

Answer:

Templates allow to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until certain point they fulfill the functionality of a macro. Its prototype is any of the two following ones:

template function_declaration; template function_declaration;

The only difference between both prototypes is the use of keyword class or type name, its use is indistinct since both expressions have exactly the same meaning and behave exactly the same way.

Asked In ::

Post Your Answer Here:


Rate This: +0 -0     
Report    

Post Your Reply Here:

Alert me
q4i-reply-your-answer

Report Error

Please Login First Click Here

Most Popular Qs.