I'm writing a program to count blanks, tabs, and newlines. I remember what the escape sequence for tabs and newlines are, but what about blanks? \b
? Or is that backspace?
\t (Horizontal Tab) This is the escape sequence for the horizontal tab. Words that come after '\t' will be pushed in the same line leaving some spaces. Its ASCII value is 009.
In particular, the \n escape sequence represents the newline character. A \n in a printf format string tells awk to start printing output at the beginning of a newline.
\xhh (Hexadecimal number) – We use it to represent a hexadecimal number. \v (Vertical tab) \b (Backspace) \e (Escape character)
You mean "blanks" like in "a b"
? That's a space: ' '
.
Here's a list of escape sequences for reference.
If you want to check if a character is whitespace, you can use the isspace()
function from <ctype.h>
. In the default C locale, it checks for space, tab, form feed, newline, carriage return and vertical tab.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With