开发者

Xcode Debugger Hover over variable, what does '\ <some stuff> ' mean?

In 开发者_StackOverflow中文版Xcode (v3.1) debugger if I hover over a struct variable such as sockaddr_in I see:

alt text http://img43.imageshack.us/img43/756/picture3ac.png

Notice the difference between sin_port and sin_family/sin_len. What is the meaning of '\002' in the case of sin_family. Why is it not displayed as just "2"?


'\002' means 02 interpreted as an octal (base 8) number, similar to how '\x02' would be the same for a hex (base 16) number. As to why X-Code still uses octal, I'm stumped...

The reason it's only displaying octal representations for those variables is because they are declared as char's. This still doesn't explain the 'why octal' question, but it does answer the 'why' one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜