+ 3
What does the /b /r /t /a do in c programming
2 ответов
+ 3
They are special characters.
They exist because escape characters don't have own character, there is no 1 character representatikns for characters, such as newlines and tabs, so they are represented as backslash \ followed by a character.
\b represents a backspace
\r represents a carriage return
\t represents a tab
\a represenst a bell.
I don't actually know what carriage return and bell does, but tab often represents 4 spaces and \b represents backspace (hides previous character).
printf("hello\tworld!"); #hello world!
printf("hello\bworld!"); #hellworld!
+ 3
thanks