SHARE
TWEET

Untitled

genets Jun 25th, 2019 (edited) 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Time1
  5. {
  6.     public:
  7.         Time1();
  8.         Time1(int h, int m, int s);
  9.         virtual ~Time1();
  10.  
  11.     protected:
  12.         int H, M, S;
  13.     private:
  14. };
  15.  
  16. Time1::Time1()
  17. {
  18.     H = 15;
  19.     M = 44;
  20.     S = 10;
  21.  
  22.     cout << "Вызов конструктора для объекта " << this << endl;
  23. }
  24.  
  25. Time1::Time1(int h, int m, int s)
  26. {
  27.     H = h;
  28.     M = m;
  29.     S = s;
  30.  
  31.     cout << "Вызов конструктора для объекта " << this << endl;
  32. }
  33.  
  34. Time1::~Time1()
  35. {
  36.     cout << "Вызов деструктора для объекта " << this << endl;
  37. }
  38.  
  39. int main()
  40. {
  41.     setlocale(LC_ALL, "rus");
  42.  
  43.     cout << "Nikita"<<endl;
  44.  
  45.     Time1 time1(12, 20, 45);
  46.     Time1 time2;
  47.  
  48.     return 0;
  49. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top