What's wrong with this..

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

What's wrong with this..
  1. Unread #1 - Nov 18, 2007 at 5:19 PM
  2. WoW Sucks
    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0

    WoW Sucks Global Moderator
    Banned

    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.
     
  3. Unread #2 - Nov 18, 2007 at 6:04 PM
  4. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    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.
     
  5. Unread #3 - Nov 19, 2007 at 5:07 AM
  6. WoW Sucks
    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0

    WoW Sucks Global Moderator
    Banned

    What's wrong with this..

    Nope, not worked =/

    Thanks anyway.
     
  7. Unread #4 - Nov 19, 2007 at 7:58 AM
  8. -------owned-------
    Joined:
    Jan 27, 2007
    Posts:
    1,225
    Referrals:
    0
    Sythe Gold:
    0

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

    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;
    }
    
     
  9. Unread #5 - Nov 19, 2007 at 4:08 PM
  10. WoW Sucks
    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0

    WoW Sucks Global Moderator
    Banned

    What's wrong with this..

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

Users viewing this thread
1 guest


 
 
Adblock breaks this site