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

Recommended Answers

All 5 Replies

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;
}
commented: 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

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

So exactly why didn't you try my code?

So exactly why didn't you try my code?

didn't understand it, but I do now
cheers

Be a part of the DaniWeb community

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