• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2514
  • Last Modified:

Move cursor on console screen in C++

How to move cursor to the point what have coordinate assigned before .

0
nickphson
Asked:
nickphson
  • 2
1 Solution
 
prakash2007Commented:
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
 
nickphsonAuthor Commented:
I'm coding in window32 console not in window application.
0
 
prakash2007Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now