?
Solved

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

Posted on 2000-02-23
9
Medium Priority
?
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 5

Accepted Solution

by:
laeuchli earned 9 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:Wyn
ID: 2553636
Sorry too , I didnt looked the original question but follow the answer:)
0
 

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

765 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