03-06-2007
6,
0
Join Date: Dec 2006
Last Activity: 24 September 2007, 1:25 AM EDT
Posts: 6
Thanks Given: 0
Thanked 0 Times in 0 Posts
printf("%c[%d;%df",0x1B,y,x);
Can u tell me how to understand the line below
printf("%c[%d;%df",0x1B,y,x);
Actually a function is written as
void gotoxy(int x,int y)
{
printf("%c[%d;%df",0x1B,y,x);
}
I wanted to know that why %c[%d;%df is used.I mean to say why and when
[ and ; is used in between %c and %d in printf statement and 0x1b is passed to %c. I know gotoxy (in above) is used to place the cursor at (row,column).So what happen internally i wanted to know?
i am very thank full that u people help me by giving ur precious time.
One more question here
i do not understand that function used for clear screen (given below)
cls
{
union REGS i,o;
i.h.ah=6;
i.h.al=0;
i.h.ch=0;
i.h.cl=0;
i.h.dh=24;
i.h.dl=79;
i.h.bh=7;
int86(16,&i,&o);
}
In Above function Registers are used(i think) but why and internally what the do for clearing the screen , i do not understand.
Thanks in advance
Last edited by brain_full; 03-07-2007 at 11:22 AM..