News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Newbie Question About the Code at the end

Started by bingobeawr, August 03, 2008, 04:06:44 AM

Previous topic - Next topic

bingobeawr

I noticed that CodeBlocks have built in code for not closing a window when the program is executed. While in Other compilers you use such code as
       std::cout << "Press the enter key to exit";
        std::cin.ignore(std::cin.rdbuf()->in_avail()+1);

Where can I find the script to edit this in Code Blocks.

elzorro

I think it's not in any script.

In the windows version there is an executable named "cb_console_runner.exe" in codeblocks installation directory that handles execution of the programs.

If you type "C:\CodeBlocks\cb_console_runner.exe calc.exe" it runs calc.exe and when you close the application it prints the message you mention and pauses the console until you press a key. Replace "C:\CodeBlocks" with your installation directory and calc.exe with your executable

Maybe you could make your own "cb_console_runner.exe" and replace it, or search in the source of codeblocks.

thomas

If you don't want that behaviour, turn it off in the project options. No need to change code.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."