Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

MMJ1989

@MMJ1989
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • relational operators in class time
    M MMJ1989

    hello hello hello simply i have this code . and i need help to modify or change >= operators in class .

    #include using namespace std ;

    class time
    {
    private :
    int hour ;
    int minute ;
    int second ;
    public :
    time ()
    {}
    time (int h , int m , int s ) : hour ( h) , minute (m) , second(s)
    {}
    void get ()
    {
    cin >> hour >> minute >> second ;
    }
    void show ()
    {
    cout << hour << " : " << minute << " : " << second << endl ;
    }

       bool operator >= ( time r ) 
       { 
    	   if ( hour >= r.hour  ) 
    		   {
    			  if ( hour > r.hour ) 
    			  { 
    				  return true ; 
    			  }
    			  else 
    			  {
    				  if ( minute >= r.minute ) 
    				  {
    					  if ( second >= r.second ) 
    						  return true ; 
    						else 
    							return false ; 
    				  } else { 
    					  return false ; 
    				  }
    			  }
    			   
    		   }  
    	   else 
    		   return false ; 
       } 
    

    };

    int main ()
    {
    time a, b ;
    a.get() ;
    b.get() ;

    a.show() ; 
    b.show () ; 
    
    if ( a >= b ) 
    	cout << "true  \\n" ; 
    else 
    	cout << "not true \\n" ; 
    
    return 0 ; 
    

    }

    C / C++ / MFC help

  • How to learn C++
    M MMJ1989

    learn C++ is not by only reading boooooks . you must think like a programmer and understand the idea behind the code .

    C / C++ / MFC tutorial c++ learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups