without using curses.h
how do u set cursor location??
without using curses.h
how do u set cursor location??
I *think* that ansi.sys has be loaded before using escape sequences... in dos anyway.Originally posted by vVv
See if
works for your terminal.Code:#include <stdio.h> int x = 5, y = 10; printf( "\033[%d;%df", y, x ); puts( "hello" );
wtam, search this board as I *know* that I saw a windoze solution posted not too long ago. If you're using a dos compiler, then you would have access to gotoxy in Borland and _settextposition in MS.
I have no idea using other operating systems or compilers.
I haven't used a compiler in ages, so please be gentle as I try to reacclimate myself. :P
curser position
===========
by using gotoxy() function we can place the curser in required place.
syntax :
==========
gotoxy(col,row);
or it can be done by 2 for loops
======================
for(i=1;i<=row;i++)
printf("\n");
for(i=1;i<=col;i++)
printf(" ");
>>His curses-remark suggests he's using a Unix-like operating system
Err... no, he implies he doesn't have curses.h, so maybe it isn't *nix. Either way, a pointless conversation until the OP gives the proper information.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
i m using unix, so escape sequence works
thank you
From Salem's earlier post: be specific about which OS and compiler you haveOriginally posted by wtam
i m using unix, so escape sequence works
thank you
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]