?
Solved

Move cursor on  console screen in C++

Posted on 2008-11-06
3
Medium Priority
?
2,456 Views
Last Modified: 2012-08-13
How to move cursor to the point what have coordinate assigned before .

0
Comment
Question by:nickphson
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
prakash2007 earned 150 total points
ID: 22903013
Hi,
You can use the following Windows function.

remember to #include "Windows.h"
COORD coord;
coord.X = 20; // your X cord
coord.Y = 20; //your Y cord
SetConsoleCursorPosition(GetStdHandle( STD_OUTPUT_HANDLE ),coord);

Open in new window

0
 

Author Comment

by:nickphson
ID: 22904598
I'm coding in window32 console not in window application.
0
 
LVL 2

Expert Comment

by:prakash2007
ID: 22904663
Hi,
  When I told to include "Windows.h". It does'nt mean that it is a windows application. It is just included so that you can access the Windows API.

I have tested the code in a WIN32 console application under Visual C++ 6.0 IDE.

Thanks & Regards,
Prakash.R


0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

839 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