I have problem when i Run my program .I can't see the results clearly it turns to fast to see, and it goes back to my program. Do you know how to solve this?please...

Recommended Answers

add a line at the end of main() to make the program want for you to press a key

int main()
{
   <snip> // your code goes here
   getchar(); // wait
}
Jump to Post

> Turbo c++ problem!
Pressing ALT-F4 might be a better option, followed by

- delete fossil compiler from system
- install one (or more) of these fine modern compilers.
http://www.microsoft.com/express/Downloads/

Jump to Post

All 6 Replies

add a line at the end of main() to make the program want for you to press a key

int main()
{
   <snip> // your code goes here
   getchar(); // wait
}

Or, maybe, in a more C++-ish way:

#include <iostream>

int main()
{
    ... // your code here
    std::cin.get();
}

or press alt + F5 or from menu windows->output after running your program to see the output. But the above two posts are the best ones to make output screen wait.

Alt F4 opens data inspect, Alt F5 will display user screen.

you wii also show the output with press alt+f5 the goes to the output screeen

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.