十六进制内存赋值

char* pCh = "0xe6, 0x97, 0xa0, 0xe7, 0x95, 0x8c, 0xe6, 0xb5, 0x8f, 0xe8, 0xa7, 0x88";字符串的形式存在于内存中,达不到预期

 

下面两种均可:

unsigned char title[] = {0xe6, 0x97, 0xa0, 0xe7, 0x95, 0x8c, 0xe6, 0xb5, 0x8f, 0xe8, 0xa7, 0x88};
char* ptitle = "\xe6\x97\xa0\xe7\x95\x8c\xe6\xb5\x8f\xe8\xa7\x88";

if (!memcmp(ptitle,title,12))
{
printf ("OK!\r\n");
}

posted on 2015-03-04 15:32  寻步  阅读(699)  评论(0编辑  收藏  举报