Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Time1
- {
- public:
- Time1();
- Time1(int h, int m, int s);
- virtual ~Time1();
- protected:
- int H, M, S;
- private:
- };
- Time1::Time1()
- {
- H = 15;
- M = 44;
- S = 10;
- cout << "Вызов конструктора для объекта " << this << endl;
- }
- Time1::Time1(int h, int m, int s)
- {
- H = h;
- M = m;
- S = s;
- cout << "Вызов конструктора для объекта " << this << endl;
- }
- Time1::~Time1()
- {
- cout << "Вызов деструктора для объекта " << this << endl;
- }
- int main()
- {
- setlocale(LC_ALL, "rus");
- cout << "Nikita"<<endl;
- Time1 time1(12, 20, 45);
- Time1 time2;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement