Code::Blocks Forums

User forums => Help => Topic started by: jinjin12 on September 17, 2011, 08:25:04 pm

Title: codeblocks injecting garbage code?
Post by: jinjin12 on September 17, 2011, 08:25:04 pm
hey guys im new to codeblocks and i have a question.  in devc++ or wxdev++ , in order for your to view the output terminal, you have to type in garbage code at the end of the main such as cin.get() or a system("pause"), otherwise the output window will come up and close immediately.  however, in codeblocks, i see that i don't have to do this as codeblocks leaves the output window open. i do that see that text in the output window looks very much like what you would see if you did a system("pause"), so is codeblocks, unbeknown to me, injecting garbage code like a system("pause") or other garbage code into my source file just to keep the window open?  i really want to know.
Title: Re: codeblocks injecting garbage code?
Post by: stahta01 on September 17, 2011, 08:46:30 pm
No, it is NOT doing that.

Try running your command/exe from the command line.

Tim S.
Title: Re: codeblocks injecting garbage code?
Post by: Jenna on September 17, 2011, 09:53:46 pm
If the "Project -> Properties -> Build targets -> [target] -> Type" is "Console application" and "Pause when application ends" is schecked, C::B runs the app through a wrapper (cb_console_runner) and the wrapper keeps the command window open.
Title: Re: codeblocks injecting garbage code?
Post by: jinjin12 on September 18, 2011, 02:04:49 am
ok cool, good to not that it's not injecting any garbage code, thanks. btw i'm using new-> empty file