Advertisement
avskyRB

Time-Tempo.h

Sep 2nd, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. class Tempo
  4. {
  5.  
  6.   public:
  7.     // Costruttore senza parametri
  8.     Tempo();
  9.  
  10.     //Costruttore 1 parametro
  11.     Tempo(int a);
  12.  
  13.     // Costruttore 3 parametri
  14.     Tempo(int a, int b, int c);
  15.    
  16.     // Tempo in secondi
  17.     int inSecondi();
  18.  
  19.     // Overloading +
  20.     Tempo operator+(Tempo &t);
  21.  
  22.     // Overloading -
  23.     Tempo operator-(Tempo &t);
  24.  
  25.     // Dichiarata friend per accedere ai membri privati
  26.     friend std::ostream& operator<<(std::ostream& o, Tempo& t);
  27.  
  28.   private:
  29.     int m_ore;
  30.     int m_min;
  31.     int m_sec;
  32. };
  33.  
  34. std::ostream& operator<<(std::ostream& o, Tempo& t);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement