Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: Léa Massiot on September 16, 2012, 06:07:04 pm

Title: What are these "\002", "\252" I'm observing when debbuging?
Post by: Léa Massiot on September 16, 2012, 06:07:04 pm
Hello,

Thank you for reading my post and sorry for the lame thread title.

I am manipulating bytes arrays like for instance:
 
Code
char bytesArray[10];

When I debug my code and visualize the contents of such an array using the C::B "Watch" functionality, I observe such "things" as:
"\002", "\252", etc.

If I do a:
Code
printf("B0 = %x\n", bytesArray[i] & 0xff);
where i is the index of the char "\252" in bytesArray,
I get AA16 which is what I'm expecting.

Yet, I don't understand what is this "\252" code. What is it?
Given such a "code", how can I manually get the corresponding hexadecimal and even binary form?
I there a table somewhere? Does this table have a name?


Thank you for helping.
Best regards.
Title: Re: What are these "\002", "\252" I'm observing when debbuging?
Post by: Léa Massiot on September 19, 2012, 11:13:23 pm
This is octal notation.

Best regards.
Title: Re: What are these "\002", "\252" I'm observing when debbuging?
Post by: Freem on September 20, 2012, 10:52:48 am
If you use watches, you can "convert" it to hexadecimal or decimal in it's properties. (right click on the watch, properties, then specify something in format)
Title: Re: What are these "\002", "\252" I'm observing when debbuging?
Post by: Léa Massiot on September 20, 2012, 10:41:19 pm
All right!
Very good. Thank you :)