Solved

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

Posted on 2000-02-23
9
194 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Focus not getting shifted out of  editbox 2 66
C Language combined operators 28 115
Getting IP address 8 89
Need some help with mailto 16 20
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

828 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