Wizard
Wizard

Reputation: 11295

C++ SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c) 2 arguments

How to use

SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c)

function when I have not 1 "c" arguments but 2 for example 2 3?

Maybe someone know better function than SetConsoleCursorPosition, gotoxy() does not work in Visual Studio :(

Upvotes: 1

Views: 11032

Answers (2)

VipulKumar
VipulKumar

Reputation: 2395

You can implement it like this:

COORD cord;
cord.X=10;
cord.Y=10;
SetConsoleCursorPosition(GetStdHandle( STD_OUTPUT_HANDLE ),cord);
cout<<"*";

This will print "*" at screen coordinates (x,y)=(10,10)

For theoretical and basic knowledge about Method, see http://msdn.microsoft.com/es-es/library/windows/desktop/ms686025%28v=vs.85%29.aspx

Upvotes: 1

selalerer
selalerer

Reputation: 3934

As you can see here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682119%28v=vs.85%29.aspx

CORD is a struct and contains two values, the x value and the y value.

Upvotes: 1

Related Questions