Solved

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

Posted on 2000-02-23
9
191 Views
Last Modified: 2010-04-02
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
Comment
Question by:lseng
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 5

Accepted Solution

by:
laeuchli earned 3 total points
ID: 2552682
try this:
cout<<"PRESS ENTER\n";
anykey = getchar();
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2553301
Right.
And You'd use this for c++

cout<<"press enter"<<endl;

Regards
W.Yinan
0
 
LVL 1

Expert Comment

by:lar_jens
ID: 2553538
I'm sorry, wasn't the problem here that the cursor DID go down to the next line?
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2553636
Sorry too , I didnt looked the original question but follow the answer:)
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Expert Comment

by:yaary
ID: 2554545
try this code :
   
 cout << "press enter to continue. ";
 cin >> anykey;


 
0
 

Author Comment

by:lseng
ID: 2561489
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
 
LVL 5

Expert Comment

by:laeuchli
ID: 2561722
sence you are offering only 3 points, it must not be that hard......
0
 
LVL 1

Expert Comment

by:lar_jens
ID: 2564040
All right..

Try this

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

C if that works!!!
0
 

Expert Comment

by:yaary
ID: 2564080
sorry,
try this code.
"
printf("Press enter to continues");
while (!(anyKey=_kbhit()));
anyKey = _getch ();
"
good luck
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now