My Blog
Articles related to programming, computer science, technology and research.

CPP program to create a function template for swapping

31/03/2017 Categories: Templates. No Comments on CPP program to create a function template for swapping

A C++ program to create a function template for swapping. Program is as follows: #include <iostream> using namespace std; template<class T> void swapme(T &x, T &y) { T temp = x; x = y; y = temp; } int main() { int a, b; cout<<“Enter two integer values: “; cin>>a>>b; swapme(a, b); cout<<“After swap a = […]

Read the rest of this entry »

CPP program to create a function template for power of a number

31/03/2017 Categories: Templates. No Comments on CPP program to create a function template for power of a number

A C++ program to create a function template for power of a number. Program is as follows:

Output for the above program is as follows:

 

Read the rest of this entry »

CPP program to illustrate member function template

31/03/2017 Categories: Templates. No Comments on CPP program to illustrate member function template

A C++ program to illustrate member function template. Program is as follows:

Output for the above program is as follows:

 

Read the rest of this entry »

CPP program to illustrate template class with multiple parameters

31/03/2017 Categories: Templates. No Comments on CPP program to illustrate template class with multiple parameters

A C++ program to illustrate template class with multiple parameters. Program is as follows:

Output for the above program is as follows:

 

Read the rest of this entry »

CPP program to illustrate template class

31/03/2017 Categories: Templates. No Comments on CPP program to illustrate template class

A C++ program to illustrate template class. Program is as follows:

Output for the above program is as follows:

 

Read the rest of this entry »
Scroll Up