Adblock breaks this site

What's wrong with this..

Discussion in 'Programming General' started by WoW Sucks, Nov 18, 2007.

  1. WoW Sucks

    WoW Sucks Global Moderator
    Banned

    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0
    What's wrong with this..

    Code:
    #include <iostream> 
    #include <windows.h> 
    using namespace std; 
    
    int seconds = 60;
    int minutes = 19;
    
     
    void main(void) 
    { 
    	
    		
    	 cout << "Your skull will be gone in: " << minutes << ":" << seconds << endl;
    	 while ((seconds > 0) && (minutes > 0));
    		 	 
         {
    		 seconds--;
              Sleep(1000);
          
         }
         
    	 if (seconds == 0)
    		 minutes--;
    
    	 if (minutes == 0)
    		 cout << "Your Skull Should Have Gone" << endl;
         
    }
    
    Its meant to be a skull timer, ive been learning C++ for approx 1 hour, and ive tried to make this.

    If its a complete failure, just tell me. If not, help please :)

    Thanks.
     
  2. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    What's wrong with this..

    I don't know c++, but I do know that in most, if not all, the if structures should be in this format:

    if(this=="that")

    Note the two equal signs.
     
  3. WoW Sucks

    WoW Sucks Global Moderator
    Banned

    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0
    What's wrong with this..

    Nope, not worked =/

    Thanks anyway.
     
  4. -------owned-------

    -------owned------- Guru
    Banned

    Joined:
    Jan 27, 2007
    Posts:
    1,225
    Referrals:
    0
    Sythe Gold:
    0
    What's wrong with this..

    What about this?
    Code:
    #include <iostream.h>
    #include <windows.h>
    
    int main() {
    int minutes = 20;
    int sleeptime = minutes * 60 * 1000;
    Sleep(sleeptime);
    return 0;
    }
    
     
  5. WoW Sucks

    WoW Sucks Global Moderator
    Banned

    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0
    What's wrong with this..

    Fixed, thanks to Cruel :)
     
< RS world map??? | My Java source.. >


 
 
Adblock breaks this site