#include<iostream>
#include<conio.h>
using namespace std;
template <class T>
class name
{
public:
T elemant;
name(T any)
{
elemant=any;
}
T print()
{
return elemant;
}
};
int main()
{
string str;
int id;
cout << "Enter Name of the student... : ";
cin>>str;
name<string> nm(str);
cout << nm.print();
cout << endl;
cout << "Enter Id Of The student... : ";
cin >> id;
name<int> d(id);
cout << d.print();
cout << endl;
getch();
return 0;
}
#include<conio.h>
using namespace std;
template <class T>
class name
{
public:
T elemant;
name(T any)
{
elemant=any;
}
T print()
{
return elemant;
}
};
int main()
{
string str;
int id;
cout << "Enter Name of the student... : ";
cin>>str;
name<string> nm(str);
cout << nm.print();
cout << endl;
cout << "Enter Id Of The student... : ";
cin >> id;
name<int> d(id);
cout << d.print();
cout << endl;
getch();
return 0;
}