hello guys today, i m gonna about remaining escape sequences::
output :
output :
output :
\r = carry return character
so how it works??
/r will return cursor of our console window to the starting of that line for example:
#include<stdio.h>
void main()
{
printf("hello \r");
}
hello //and cursor will return to h
soo if we write
printf("hello \rk");
kello // as cursor is in the position of h and if we further write anything it will overwrite h
\b=backspace character
backspace character is nearly same as \r the only difference is that unlike \r , \b does not shift cursor to the starting of the line rather it just shift's the cursor 1 step back.....
void main()
{
printf("hello\bu");
}
hellu //as \b shifted the cursor 1 step back where o is there .....so after that when we printed u ...it overwrites on o;
\t =tab character
tab character shifts cursor to the new tab columns ....tab columns consist of 8 spaces
caution it does not move cursor 8 spaces ahead rather it only moves cursor to the new tab column
ie. if cursor is in 8th position of tab column it only moves cursor 1 step ahead ,if cursor is in 1st position of tab columns then it will move the cursor 8 steps ahead .....
Printf("hello \tuser \nhi \tuser");
Printf("hello \tuser \nhi \tuser");
Thank u !!!
0 comments:
Post a Comment