Selasa, 27 Desember 2016

What are the generic Datatypes in C++ programming

Every template data type (or generic data type) should be used as types in the function template definition as type of parameters. If not used, it will result in an error. Consider the following example which leads to an error: 1 2 3 4 5 template<class Type> void summ(int x, int y) //Error since Type is not used for arguments x and y { cout<<“Sum is: “<<x+y<<endl; }   Also using some of the template data types is also wrong. Consider the following example which leads to an error: 1 2 3 4 5 template<class Type1, class Type2> void summ(Type1

The post What are the generic Datatypes in C++ programming appeared first on Coding Security.


What are the generic Datatypes in C++ programming
read more

Tidak ada komentar:

Posting Komentar