I'm am just running simple programs right now. For example the hello world code, but i never get to see if it works or not. After it compiles the black window comes up then it just quits. If i put in another command after like cin then the window stays up and i can see the hello world. What can I do to fix this.

Program just quits
paradoxium
Hmm, let's compare our test apps. Mine is:
#include <iostream>
void main()
{
std::cout << "Hello World" << std::endl;
std::cin.get();
}
And that keeps the console until I press <return>.
How does your app look like. Might it cause an exception that crashes the app so it never reaches cin.get()
--
SvenC
JUNJIE.HONG
You can also put a
at the end of your program.
hey_ian
Hi,
in native code use:
std::cin.get() // wait until return is pressed
in managed code use:
Console::ReadKey();
--
SvenC
RoryD
Drunkboat
Pavel Burianek
Make sure you place the cin.get() prior to a return statement, or similar flow of control. If neccessary, place a breakpoint at the cin.get()-call and see if it's even executed.
Evan Mulawski
use Debug--->Execute command to start you program
After the program exit, the string "Press any key to countinue..." will be shown and the window will not close until you press any key