program has stopped working

so when i go to run the program i just get a error message saying the the program has stopped working correctly. now i know im new like brand new to this so any help is great lol

#include <iostream>
using namespace std;

int main ()
{

char letter ; letter = 'A' ; // declared then initialized.
int number ; number = 100 ; // declared then initialized.
float decimal = 7.5 ; // declared and initialized.
double pi = 3.14159 ; // declared and initialized.
bool isTrue = false ; // declared and initialized.

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 ;
}
Works fine for me. :-S
Look fine to me technically with letter and number they are not initialed. You just assigned a value to the uninitialized value. Also if you output a boolean like that it will display a 1 or 0 at the top add the precompiled header #include <iomanip> the before your boolean put boolalpha <<
so if everything looks good then how come im getting the error message for the program not working properly when i run it

and side note so would the boolean look like

boolalpha << bool isTrue = false ;

bc im confused on that part
What exactly are the errors? I do not see any and I meant like this
1
2
3
4
5
6
7
8
#include <iostream>
#include <iomanip>

int main()
{
    bool isTrue = false;
    std::cout << "Bool isTrue: " << std::boolalpha << isTrue << std::endl;
}

I used std:: instead of using namespace std; since I'm not using all the other things in that namespace.
the error come when it starts the programs starts it gets the first line through and i can see it then it is basically a not responding kinda thing is there a way i can attach a screen shot so i can show you. i run the .exe and then got a

windows error

a problem cause the program to stop working correctly
windows will close the program and notify you if a solution is available

is it just my computer some thing i need to change. if so what lol
Try running it using the compiler instead you might be missing a .dll also you can put the image on a site that allows you to upload images then put the link here.
how do i run it using the compiler =/ and the book never said anything about making a .dll
Build it then run it. And certain IDE's don't compile it with the .dll like qt.. But if you are using visual studios or code::blocks you shouldn't need that. Anycase most people run the program via the IDE and not the .exe file.
ya im not using visual studios im using mingw gnu gcc.. so how do i run it with the IDE.. i sound so dumb ha feel like a idiot
Code::Blocks?
Dev-C++?
Orwell Dev-C++?
nope none of them im literally just starting out and teaching myself so any help is great
Where are you writing the code? Notepad?
As you're just beginning, I'd suggest you to use an IDE like Code::Blocks ( http://www.codeblocks.org/downloads/26 , take the MinGW 96mb setup) or Orwell Dev-C++ ( https://sourceforge.net/projects/orwelldevcpp/ )
haha umm no but yes lol im using notepad++
and i certainly will go and download those. you guys have been a big help
Topic archived. No new replies allowed.