If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Setting char value

All, I have attached a snapshot of the issues I am dealing with.

const char CR = '\13';
const char LF = '\10';

const char CR2 = '\15';
const char LF2 = '\12';

In the locals watch window it shows that the CR value is 11 instead of 13, and my line-feed LF has a value of 8 instead of 10. If I add 2 to the value as CR2 and LF2 show, then the watch windows shows them as 13 and 10.

Re: Setting char value

This is because:
'\10' = 10 in octal = 8 in decimal

there is also a notation for hexadecimal:
'x10' = 10 in hexadecimal = 16 in decimal

There is... strangely enough... no way in C/C++ to enter a decimal value as an escape sequence, for some special characters there are specific sequences though. Such as
'\n' for linefeed/newline (10 decimal, '\xa' or '\12')
'\r' for carriage return (13 decimal '\xd' or '\15')
...

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.