0

I'm having trouble making a simple 'Hello World' screen output in C++, in Code Blocks. The problem arises when I try to compile and run the code. When the code has been compiled and a console window appears, the only visible text is the following:

Process returned 1988768175 (0x768A31AF) execution time : 0.641 s Press any key to continue

The program terminates before I'm able to see it. I've been searching for a while now, and I haven't been able to locate what causes this. I'm using Code Block 13.12 with default settings on Windows 8.1 x64, and my code is a follows.

#include <iostream>
using namespace std;

int main()
{
    cout << "Hello";
    return 0;
}
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278

1 Answers1

0
#include <iostream>
using namespace std;

int main()
{
    cout << "Hello";
    getchar();
    return 0;
}
Athenoa
  • 16
  • 7
    A penny for your thoughts? While this may solve op's problem, giving some dialogue about why it's happening and why this fixes it would be nice. – ChiefTwoPencils Dec 29 '14 at 01:41