Welcome
Welcome to the forums of AntiRTFM's Absolute N00b Spoonfeed C++ Tutorials!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Seting the puter onto a X,Y cordinate

Display your little helpful snippets of code that may help us all get something done

Seting the puter onto a X,Y cordinate

Postby NOOB on Fri Apr 17, 2009 7:24 am

I dindt write that code, but its nice to know (i searched long for it :D )


Code: Select all
#include <iostream>
#include <windows.h>

using namespace std;

void gotoxy(int x,int y)
{
   COORD cur={x,y};
   SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),cur);
}


gotoxy(X,Y);
will now set thes puter to the X,Y cordinates.
NOOB
 
Posts: 59
Joined: Tue May 06, 2008 11:04 am

Re: Seting the puter onto a X,Y cordinate

Postby antiRTFM on Sat Apr 18, 2009 10:51 pm

Caution though, this is Win32 Console Application exclusive code, involving non-standard C++
User avatar
antiRTFM
Administrator
 
Posts: 462
Joined: Sun Apr 13, 2008 9:10 am

Re: Seting the puter onto a X,Y cordinate

Postby glinka57 on Thu Apr 23, 2009 2:19 am

LOL..
Check this out I posted
select-character-insertion-point-t213.html

Its a nice func,
User avatar
glinka57
 
Posts: 158
Joined: Fri Feb 27, 2009 7:32 pm


Return to Snippets

Who is online

Users browsing this forum: No registered users and 0 guests