Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

anybody know what it mean ..... cout << " Press Enter to continues......"

Hi, All experts

  In my console program, I wrote
 ""
 cout << "Press enter to continues";
 anykey = getchar();
 ""
I do not know why in VC++ 6.0 the cursor does not stay right after " press enter to continues..._ <--- cursor
.What it do is to move the cursor to the secod line ( after Press enter to continues) at the output screen.

anybody know how........

Thank you.

 
0
lseng
Asked:
lseng
  • 2
  • 2
  • 2
  • +2
1 Solution
 
laeuchliCommented:
try this:
cout<<"PRESS ENTER\n";
anykey = getchar();
0
 
WynCommented:
Right.
And You'd use this for c++

cout<<"press enter"<<endl;

Regards
W.Yinan
0
 
lar_jensCommented:
I'm sorry, wasn't the problem here that the cursor DID go down to the next line?
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
WynCommented:
Sorry too , I didnt looked the original question but follow the answer:)
0
 
yaaryCommented:
try this code :
   
 cout << "press enter to continue. ";
 cin >> anykey;


 
0
 
lsengAuthor Commented:
hi, all experts

  It still not work! it work with Borland C++ but not MSVC++
  The cursor still stay at the bottom of the "Press anykey to continues" *** not the one the came with the MS VC++ compiler

Thank You all

LY

0
 
laeuchliCommented:
sence you are offering only 3 points, it must not be that hard......
0
 
lar_jensCommented:
All right..

Try this

cout << "Press enter to continue\n\n\n\n\n\n\n\n" ;

C if that works!!!
0
 
yaaryCommented:
sorry,
try this code.
"
printf("Press enter to continues");
while (!(anyKey=_kbhit()));
anyKey = _getch ();
"
good luck
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now