C Comments and Escape Sequences
Comments help to keep your code readable and organized, while escape sequences enable handling special characters.
Comments
Comments include explanations or notes about the code.
Comments can be either:
- Single-line comments:
Single-line comments have a double forward slash
//.Example:
// Example of a valid single line comment. - Multi-line or block comments:
Multi-line or block comments have
/*(start of a block comment) and*/(end of a block comment),Example:
/* Example of a valid block comment */
Escape Sequences
Escape sequence are special characters, such as new lines, tabs, or quotation marks, that you can't directly enter into a string. They start with a backslash \ followed by a character.
Examples:
\n: newline-
\t: tab \r: carriage return\': single quote\": double quote\b: backspace\f: form feed\v: vertical tab