#include (iostream.h)
class Hitung
{
private:
unsigned int cacah;
public:
Hitung(){cacah=0;};
Hitung(int c){cacah = s;}
int get_Hitungan(){return cacah;}
Hitung operator += ()
{
cacah+=;
return Hitung(cacah);
}
~Hitung(){}
};
int main()
{
Hitung s1, s2, s3;
cout << “\ns1 = ” << s1.get_Hitungan();
cout << “\ns2 = ” << s2.get_Hitungan();
s1 += s2;
s3 = s1 += s2;
cout << “\ns1 = ” << s1.get_Hitungan();
cout << “\ns2 = ” << s2++.get_Hitungan();
cout << endl;
return 0;
}
Tidak ada komentar:
Posting Komentar