Thread: C::B console can't close

  1. #1
    Registered User
    Join Date
    May 2012
    Posts
    71

    C::B console can't close

    I encounter few times that Code::Blocks console can't close at all.
    I tried Task Manager close,

    Console is opened from Avast! antivirus virtual box, there is option to stop the running program but not working too,

    normal close dotn work also, F4, Ctr+Alt+Del also.
    I have to resstart the computer to close it.
    A friend told me that this happens due to infinite loop, so here is my code, please ctake a time to check it.
    Code:
    while (tries != 0){
    
            //get user input
            input = getch();
    
    
            //Search if inputed char exists in the word, if so apply them
            for (unsigned int x = 0; x < strlen(word); x++){
    
    
                if (input == word[x]){
                    hideWord[x] = input;
                }
                else{
                    wrongLetter++;
                }
            }
            if (wrongLetter == strlen(word)){ //if letter do not exist in word, increment tries with 1
                tries--;
            }
            wrongLetter = 0;
    
    
            //Print changes
            for (unsigned int i = 0; i < strlen (word); i++){
                cout << hideWord[i] << " ";
            }
            cout << endl << "tries left: " << tries << endl;
    
    
        } //while ends
    PS: The code is just testing before implementing it to functions and adding to main project.

  2. #2
    Registered User
    Join Date
    May 2012
    Posts
    71
    Sorry for the double post, does anyone have any idea what might be wrong?

  3. #3
    Registered User
    Join Date
    May 2012
    Posts
    71
    Sorry for the 3rd post, huh. Just now the console cant close agai and i have to reboot pc..
    I came across on prblem with Microsoft C++ IDE that has the same problem, they released some patch and got the bug fixed, but i am using Code::Blocks IDE and not feeling liek changing it
    I read that some people deleted a Windows update that fixed the problem for them, i also did it and few days was okay, until today where i entered infinite loop and console just..stucks, like a zombie.

    If anyone have any information on what might be, please post. Ty

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. when parent process close, how to close the child?
    By omega666 in forum C Programming
    Replies: 4
    Last Post: 04-06-2011, 12:23 AM
  2. Immediate close?
    By george7378 in forum C++ Programming
    Replies: 3
    Last Post: 02-19-2011, 04:00 PM
  3. Close console without hitting enter
    By Cathalo in forum C++ Programming
    Replies: 5
    Last Post: 05-02-2009, 08:32 AM
  4. Can't turn off a console close button
    By Xzyx987X in forum Windows Programming
    Replies: 9
    Last Post: 03-26-2004, 02:23 AM
  5. Win32 Console App... multiple console buffers
    By Trauts in forum Windows Programming
    Replies: 2
    Last Post: 04-28-2003, 11:26 AM