Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cursor positioning command

Status
Not open for further replies.

hughLg

Programmer
Feb 18, 2002
136
MY
is there anybody show me the portable subroutine (s) to allow cursor positioning command? such as gotoxy in pascal...

i'm using the Microsoft Visual C++ 6.0. what is the solution?

thanks.
 
you could use gotoxy(x, y) function in C, but only if your compiler supports the #include file <conio.h>

#include <conio.h>
#include <stdio.h>

int main (void)
{
printf(&quot;The first line\n\n&quot;);
printf(&quot;note the cursor position now\n&quot;);
printf(&quot;Hit any key and THEN first line changes&quot;);
getchar();
gotoxy(0, 0);
printf(&quot;OVER WRITTEN HERE\n&quot;);
printf(&quot;note the cursor position now\n&quot;);
getchar();
gotoxy(20,10);
printf(&quot;OVER HERE ALSO\n&quot;);
return 0;
} Hoping to get certified..in C programming.
 
theres the ncurses package available for most unix/linux distributions and i've seen a port for the cygwin windows based environent might be worth a look but a lot of these are not very portable. &quot;There are no stupid questions, just lots of inquisitive idiots&quot; - anon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top