Friday, 6 May 2016

escape sequences (part-2)

hello guys today, i m gonna  about remaining escape sequences::





\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");
}

output :

hello  //and cursor will return to h

soo if we write

printf("hello \rk");

output :

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");

}

output :

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");

 

        Thank u !!!

Related Posts:

  • escape sequences (part-2) hello guys today, i m gonna  about remaining escape sequences:: \r = carry return character  so how it works?? /r will return curs… Read More
  • conio Hello guys, today i am gonna tell you about the header file which is <conio.h>.. here is our basic program we are gonna study all of … Read More
  • IDE.....!!!! HELLO  guys , today i am gonna show you guys how to install IDE  of C langugae... SO  guys what is an IDE ? well guys ,IDE stands … Read More
  • BASIC C program hello guys , today we are gonna start with our 1st program in C language....we are gonna learn this program in small small parts cause this is yo… Read More
  • stdio.h????? hello guys, today i am gonna tell you about most used header file which is <stdio.h>.. here is our basic program we are gonna study all of… Read More

0 comments:

Post a Comment