Solved

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

Posted on 2000-02-23
9
196 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 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
Independent Software Vendors: 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

Industry Leaders: 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!

Question has a verified solution.

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

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…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

729 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