readout

Please support our C++ advertiser: Intel Parallel Studio Home
View Poll Results: Is this a common problem
Yes 2 100.00%
No 0 0%
It's you 1 50.00%
noob 0 0%
Multiple Choice Poll. Voters: 2. You may not vote on this poll

Thread Solved

Join Date: Oct 2009
Posts: 4
Reputation: fazzer2 is an unknown quantity at this point 
Solved Threads: 0
fazzer2's Avatar
fazzer2 fazzer2 is offline Offline
Newbie Poster

readout

 
0
  #1
Oct 8th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,846
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 298
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Roasting Maven
 
1
  #2
Oct 8th, 2009
Put a std::cin.get() (C++) or : getchar() (C) right before the return 0; in main().

  1. int main(){
  2. // do stuff
  3. std::cin.get();
  4. return 0;
  5. }
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 4
Reputation: fazzer2 is an unknown quantity at this point 
Solved Threads: 0
fazzer2's Avatar
fazzer2 fazzer2 is offline Offline
Newbie Poster
 
0
  #3
Oct 9th, 2009
Originally Posted by niek_e View Post
Put a std::cin.get() (C++) or : getchar() (C) right before the return 0; in main().

  1. int main(){
  2. // do stuff
  3. std::cin.get();
  4. return 0;
  5. }
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 4
Reputation: fazzer2 is an unknown quantity at this point 
Solved Threads: 0
fazzer2's Avatar
fazzer2 fazzer2 is offline Offline
Newbie Poster
 
-1
  #4
Oct 9th, 2009
Originally Posted by niek_e View Post
Put a std::cin.get() (C++) or : getchar() (C) right before the return 0; in main().

  1. int main(){
  2. // do stuff
  3. std::cin.get();
  4. return 0;
  5. }
I think I have it. If I put
int ch;
ch = getc(stdin)
the window stays open
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,846
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 298
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Roasting Maven
 
0
  #5
Oct 9th, 2009
So exactly why didn't you try my code?
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 4
Reputation: fazzer2 is an unknown quantity at this point 
Solved Threads: 0
fazzer2's Avatar
fazzer2 fazzer2 is offline Offline
Newbie Poster
 
1
  #6
Oct 9th, 2009
Originally Posted by niek_e View Post
So exactly why didn't you try my code?
didn't understand it, but I do now
cheers
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC