User forums > Using Code::Blocks
Newbie Question About the Code at the end
(1/1)
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.
Navigation
[0] Message Index
Go to full version