Link to home
Start Free TrialLog in
Avatar of lseng
lseng

asked on

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.

 
ASKER CERTIFIED SOLUTION
Avatar of laeuchli
laeuchli

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wyn
Wyn

Right.
And You'd use this for c++

cout<<"press enter"<<endl;

Regards
W.Yinan
I'm sorry, wasn't the problem here that the cursor DID go down to the next line?
Sorry too , I didnt looked the original question but follow the answer:)
try this code :
   
 cout << "press enter to continue. ";
 cin >> anykey;


 
Avatar of lseng

ASKER

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

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

Try this

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

C if that works!!!
sorry,
try this code.
"
printf("Press enter to continues");
while (!(anyKey=_kbhit()));
anyKey = _getch ();
"
good luck