gha890826

4/29課輔-建構順序

May 13th, 2020 (edited)
1,043
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. //建構順序
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. class time
  6. {
  7.     public:
  8.         time()
  9.         {
  10.             cout<<"建構time\n";
  11.         }
  12.     private:
  13.         int hour,min;
  14. };
  15.  
  16. class clock
  17. {
  18.     public:
  19.         clock()
  20.         {
  21.             cout<<"建構clock\n";
  22.         }
  23.     private:
  24.         time alerm,time_now;
  25.    
  26. };
  27.  
  28. int main()
  29. {
  30.     clock c1;
  31.     return 0;
  32. }
Add Comment
Please, Sign In to add comment