Code::Blocks Program Console

I'm trying to use Code::Blocks for the first time and trying to run the 'Hello, World!' program.

Is there any way to make the Program Console to stay open until I close it as it seems to pop open momentarily and then disappear.
 
Is there any way to make the Program Console to stay open until I close it as it seems to pop open momentarily and then disappear.

Yes, you need to add a call to the getchar() function after the initial output of 'Hello, World!'. The code should look like this:

Code:
#include <stdio.h>

int main()
{
  printf("Hello World\n");
  getchar();
  return 0;
}
 
Thanks for that. It seems like a bit of a kludge, and I would have expected that there would be some option to do this through the User Interface... The number of options is intimidating especially for somone using it for the first time. Maybe I didn't find such an option if there isn't one...
 
Back
Top