zad1.cpp
public text v1 · immutable#include <iostream> // zad1.cpp
template <class type>
class konto
{
private :
type stan;
public :
// konstruktory
konto() { stan=0; }
konto(type x) { stan=x; }
// zwrocenie elementu stan
type get() { return stan ; }
};
using namespace std;
int main() {
konto<int> obj1(4);
konto<float> obj2(0.25);
cout << obj1.get() << endl;
cout << obj2.get() << endl;
system("PAUSE");
return 0;
}