本文来自优快云移动平台-Symbian论坛帖子本人给出的解答:
const TUint8 p0[]= "10101001"; // a C string, 0xA9 = 169
const TUint8* p = p0;
TInt r = 0;
while (*p)
{
if (*p++ == '1') r |= 1;
if (*p) r <<= 1;
}
_LIT(KFormat, "%d");
RDebug::Print(KFormat, r); // 169
const TUint8* p = p0;
TInt r = 0;
while (*p)
{
if (*p++ == '1') r |= 1;
if (*p) r <<= 1;
}
_LIT(KFormat, "%d");
RDebug::Print(KFormat, r); // 169