News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

"program.exe" has stopped working

Started by Player_01, March 26, 2016, 04:10:01 PM

Previous topic - Next topic

Player_01

While testing programs of C++ using the MinGW compiler I always get the same error "program.exe has stopped working" after it displays one line of text.

For the program below the only line that's printed is "char letter: A" followed by the error window. Why is this happening?

#include <iostream>
using namespace std;
int main()
{
   char letter = 'A';
   int number = 100;
   float decimal = 7.5;
   double pi = 3.14;
   bool isTrue = false;
   
      cout << "char letter: " << letter << endl;
      cout << "int number: " << number << endl;
      cout << "float decimal: " << decimal << endl;
      cout << "double pi: " << pi << endl;
      cout << "bool isTrue: " << isTrue << endl;
      return 0;
   }
   

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]