How should templates be used? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How should templates be used?

In sololearn course, they used following syntax for template declaration template <class t> function () and somewhere online i saw that we can also use template <typename t> function () so what is different between both and which one is better.

12th May 2018, 7:01 AM
Dhruv garg
Dhruv garg - avatar
2 Answers
+ 1
Friend actually template <typename T> // It's use for declaring function template with template parameter. on the other hand template <class T> //It use for class template
13th May 2018, 11:20 AM
gfdgdfgd
+ 3
thanks bro
14th May 2018, 8:46 AM
Dhruv garg
Dhruv garg - avatar