0

Hello people
I have jusrt recently started to study C/C++ and I am using Borland 5.02. I am having a problem examining my outputs. when I run a successfully compiled program the Dos window that I should read my print from flashes on then flashes off:'( and I do not get the time to examine the results. Can any body tell me how to adjust the settings in order to read it.
Thanks
Fazzer2

2
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by fazzer2
1

Put a std::cin.get() (C++) or : getchar() (C) right before the return 0; in main().

int main(){
   // do stuff
   std::cin.get();
   return 0;
}
Votes + Comments
didn't understand it at first, but I put that down to being a noob. I understand it now
0

Put a std::cin.get() (C++) or : getchar() (C) right before the return 0; in main().

int main(){
   // do stuff
   std::cin.get();
   return 0;
}

Thank you for the reply, but it does not seem to make any sense.
Is it all there? Is it relavent to the post about my DOS window not staying open to examine results
cheers
Fazzer2

-1

Put a std::cin.get() (C++) or : getchar() (C) right before the return 0; in main().

int main(){
   // do stuff
   std::cin.get();
   return 0;
}

I think I have it. If I put
int ch;
ch = getc(stdin)
the window stays open

1

So exactly why didn't you try my code?

didn't understand it, but I do now
cheers

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.