Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: dubis07 on October 04, 2010, 04:27:48 am

Title: Mac: Terminal not showing "press any key to continue" from basic "Hello World!"
Post by: dubis07 on October 04, 2010, 04:27:48 am
Hi all -

I picked up a beginner's C++ book and it pointed me towards C::B to get started.  I'm running Mac OS 10.6.4 and whenever I build & run the default code:

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}


...I get the following output without any errors:

Last login: Sun Oct  3 21:16:34 on ttys000
/Users/(myname)/Documents/MyFirstProject/HelloWorld/bin/Debug/HelloWorld
(my first name)-(my last name)-macbook-pro:~ (my name)$ /Users/(my name)/Documents/MyFirstProject/HelloWorld/bin/Debug/HelloWorld
Hello world!
(my name)-(my name)-macbook-pro:~ (my name)$


So, ultimately, it displays the "Hello World!" message, but theres a lot of other junk there that I want to go away.  I also don't get the "Press any key to continue" message and I have to exit the Terminal window to close it.

Can anyone help with this?  I can't tell you how much it would help with my initial frustration...




Title: Re: Mac: Terminal not showing "press any key to continue" from basic "Hello World!"
Post by: afb on October 08, 2010, 12:42:08 am
You can set another terminal command to be run, if you prefer...

Environment > General settings > Terminal to launch console programs

However, the "cb_console_runner" program is not included on the Mac.

That would be the program that shows the "Press ENTER to continue."