How to escape or terminate an escape sequence in C
Yes, you cant try "\004four"
for instance. Actually, even "\04four"
will probably do, because f
is not an octal number.
You just write strings next to each other:
char a[3] = "1\02" // {'1', '\2', '\0'}
char a[4] = "1\0""2" // {'1', '\0', '2', '\0'}
sizeof("1\02") // 3
sizeof("1\0""2") // 4