Author Topic: codeblocks injecting garbage code?  (Read 4435 times)

Offline jinjin12

  • Multiple posting newcomer
  • *
  • Posts: 13
codeblocks injecting garbage code?
« 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: codeblocks injecting garbage code?
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: codeblocks injecting garbage code?
« Reply #2 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.

Offline jinjin12

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: codeblocks injecting garbage code?
« Reply #3 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