Author Topic: "program.exe" has stopped working  (Read 11512 times)

Player_01

  • Guest
"program.exe" has stopped working
« on: March 26, 2016, 04:10:01 pm »
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;
   }
   
« Last Edit: March 26, 2016, 09:55:35 pm by Player_01 »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7180
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org