Limit Limit - 1 year ago 97
C Question

How do I get the information of this string?

I am trying to debug a method right now and when I do an info locals, I get the following output:

buf = "@i\001\000\000\000\000\000\364\000\000\000\000\000\000\000\240\366fU", '\000' repeats 11 times

My question is, does \0 here mean the null character or are these characters \ and 0?
I asked this because I was expecting the string length to be less than 40 characters.

Answer Source

It's a C string escape sequence. A \ followed by 1, 2 or 3 octal digits represents an unsigned character with that octal value. As many octal digits as possible up to a maximum of 3 form part of the escape sequence, so \001 represents a single character with octal value 1. \364 represents a single character with octal value 364, which is binary 11110100, hex f4, and decimal 244 (64*3 + 8*6 + 4).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download