Author Topic: What are these "\002", "\252" I'm observing when debbuging?  (Read 10536 times)

Offline Léa Massiot

  • Multiple posting newcomer
  • *
  • Posts: 39
What are these "\002", "\252" I'm observing when debbuging?
« 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.
« Last Edit: September 16, 2012, 06:09:30 pm by Léa Massiot »

Offline Léa Massiot

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: What are these "\002", "\252" I'm observing when debbuging?
« Reply #1 on: September 19, 2012, 11:13:23 pm »
This is octal notation.

Best regards.

Offline Freem

  • Almost regular
  • **
  • Posts: 219
Re: What are these "\002", "\252" I'm observing when debbuging?
« Reply #2 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)

Offline Léa Massiot

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: What are these "\002", "\252" I'm observing when debbuging?
« Reply #3 on: September 20, 2012, 10:41:19 pm »
All right!
Very good. Thank you :)