Wednesday, September 1, 2010

HOW "\b" works

Here comes a new task definitely there will be a doubt around somewhere in the mind about how the operator '\b' generally a basic one but yes i would like to make this as a blog.
As this is program i would like to make this more like programmatic

void main()
{
printf("Hello operator\b");
}
out put:
Hello operator

Yes we find no difference in the output the only thing we find is cursor blinking at letter 'r' . This is how actually \b works it will just take the cursor to a position to its left if we try to print from there obviously the last character gets over written. This is how it happens .

void main()
{
printf("Hello operator\b");
printf("bye bye");
}
output:
Hello operatobye bye.

If we observe the output clearly we find the last letter 'r' is missing . This is how exactly the operator '\b' operator works

No comments:

Post a Comment