C Backslash Characters : Meaning
Backslash Characters : Properties
You need to learn What is Backslash Character in C Programming.
- Although it consists of two characters, it represents single character.
- Each escape sequence has unique ASCII value.
- Each and Every combination starts with back slash()
- They are non-printable characters.
- It can also be expressed in terms of octal digits or hexadecimal sequence.
- Escape sequence in character constants and string literals are replaced by their equivalent and then adjacent string literals are concatenated
- Escape Sequences are preprocessed by Preprocessor.
1. Tab : ‘\t’ Character
- It is Horizontal Tab
- Takes Control 8 spaces ahead in Borland CC++ 3.0 Compiler
#include<stdio.h> int main() { printf("Hello\t"); return(0); }
Cursor Position After Execution of Printf :
Hello _
2. New Line Character : ‘\n’ Character
- It is New Line Character
- Takes Control to new Line
#include<stdio.h> int main() { printf("Hello\n"); return(0); }
Cursor Position After Printf :
Hello _
3. Backslash : ‘\b’ Character
- It is Backslash Character
- Takes Control one position back
#include<stdio.h> int main() { printf("Hello\b"); return(0); }
Cursor Position :
Hell_
[box]Note : on ‘o’ character from Word Hello[/box]
4. Carriage Return : ‘\r’ Character
- It is Carriage Return Character
- Takes Control to First Position in the Line
printf("Hello\r");
Cursor Position :
[box]Note : Cursor on ‘H’ character from Word Hello[/box]
_allo
4. Audible Return : ‘\a’ Character
- It is audible Return Character
- Beeps Sound
printf("Hello\a");
What will happen ?
Hello
[box]After hello System Sound Beep will be started.[/box]