| mythrix (6) | |||
|
just wanted to start by saying hello and thanks for any help you guys can give me. Okay im very new to the C++ world but i cant even start at the moment.
i use this code and start it by using ctrl+f5 i get zero error's but then i get a blank cmd screen and the project name as .exe in my process list and i can't stop it and can't close the cmd window either. Im running windows 7 64bit and using Microsoft Visual C++ 2008 Express Edition | |||
|
|
|||
| apeachaday (38) | |
| For one, your using needs to be outside the main, under the #include | |
|
|
|
| apeachaday (38) | |||
Try:
| |||
|
|
|||
| mythrix (6) | |||
|
i will try that just adding little info im using this book : C++ Programming for the absolut beginner. this is what they gave me : Now, gentle reader, let us delve head first into the mystical world of C++. Though you may be overwhelmed at first with the odd symbols and cryptic terms, it will all become clear in time. So ready your torch and let us delve into this dark cavern!
The above is a complete C++ program. It simply displays the words, “Hello World” to the screen. Now, let’s take it apart, line-by-line! | |||
|
|
|||
| mythrix (6) | |
|
okay just used your code same problem no errors but CMD window apears no text nothing and programm just dous nothing. cant stop it using shift+f5 or ctrl-C and also cant stop the process by trying to kill it. It's a bit hard to explain maybe i should make a film and post it on youtube to show you guys what happens? http://www.youtube.com/watch?v=9d_USzWFxPE hope this helps | |
|
Last edited on
|
|
| Callum5042 (125) | |
|
Just wondering, are you actually making this in a Win32 console application and under a cpp file? If you are then I'm not sure what the problem is but maybe try a different compiler | |
|
|
|
| mythrix (6) | |
| Just wondering, are you actually making this in a Win32 console application and under a cpp file? Yes i did. How do you change compiler ? | |
|
|
|
| TheJJJunk (181) | ||
What program are you using to write and compile your code? | ||
|
Last edited on
|
||
| mythrix (6) | |
| Microsoft Visual C++ 2008 Express Edition so guesing this is also the compiler :P | |
|
|
|
| TheJJJunk (181) | |
| I have Microsoft Visual Studio 2011 and it works on that. You can upgrade, or try Code::Blocks | |
|
|
|
| mythrix (6) | |
|
okay this is strange i changed compiler and still getting the same problem check the youtube link to see whats happening. http://www.youtube.com/watch?v=9d_USzWFxPE | |
|
|
|
| TheJJJunk (181) | |
|
I saw on your video that another instance of the cmd opened and then instantly closed. Try adding system("PAUSE");to the bottom of your main function before the return just to see if your window is opening and instantly closing. | |
|
|
|
| Framework (3116) | |||
[-1 from TheJJJunk for suggesting the use of "system( )"]
No, they do not. I fact, it's far better than "using namespace ...". @mythrix: Try running your program from command-prompt. This is how you should be executing your programs, since console programs should not be held open. Wazzak | |||
|
Last edited on
|
|||