![]() |
|
#1
|
|||
|
|||
Opens and Closes...Ok, I'm starting to learn C++ now. But whenever I compile a program, then run it, the program opens up for a second then instantly closes. I have no clue why it does this. I'm using the same code from the C++ Book I'm learning from. (the code is posted below) I've tried 2 different compilers (Visual C++ 2008 and Dev-C++) and it does the same thing.
If someone could help me with this, please do. Oh, and I've tried running the program on Windows XP and Windows Vista and it opens for a second then closes on both... Code I'm Using: CPP / C++ / C Code:
I've also tried this code, but it doesn't work either: CPP / C++ / C Code:
Last edited by LuciWiz : 06-Apr-2008 at 12:06.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#2
|
|||
|
|||
Re: Opens and Closes...[quote=Daemonblade777]
Code I'm Using: CPP / C++ / C Code:
That's std::endl, not std::end1, right? (A lower-case ell at the end of endl, not a numeral one.) You could try: CPP / C++ / C Code:
Similarly: CPP / C++ / C Code:
Regards, Dave |
Recent GIDBlog
Last Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The