+ 1
What does templates used for?
i mean their programming and practical significance in cases. can you write?
1 Odpowiedź
0
Templates are used for writing same code for different types of objects. For example, if you create a template function for printing. Then that function can be called irrespective of the datatypes of the arguments.
Note: Templates are compile time only. Compiler creates required functions based on the type of arguments in the format of template function, at the time of compilation.