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

Can u tell me how to understand the line below

printf("%c[%d;%df",0x1B,y,x);

Thanks in advance

I cannot understand your question!

Is your question about the different format specifiers?
You could try the line within a code and you could see the output of the program

If thats not your question, please do be more specific ! :slight_smile:

no duplicate posting please!

printf("%c%d%df",0x1B,y,x);
c = char, d = double, f= float
%c represent "0X1B" or "B" only
%d represent "y"
%df reprsent "x"'
Do i answer you question?

Looks like you already understood the line yourself. What exactly is your question then?

It is printing an ANSI escape code - the ones used to control tty behavior (clear screen, move cursor, etc.)