I was looking for a substitute of gotoxy() for gcc compiler and found this -
void gotoxy(int x,int y)
{
printf("%c[%d;%df",0x1B,y,x);
}
I want to know how is it functioning, I mean when do we use [
and ;
inside printf, what is 0x1B
doing there and how does it take the cursor to the row/column with this code?
I have never seen this type of practice for printf in books,so it would be great If you could point me to a link where I can find about such uses of printf.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…