unsigned char sendBuf[10];
unsigned char *PtestChar=sendBuf;
sendBuf[0] = 0x81;
sendBuf[1] = 0x0A;
sendBuf[2] = 0x02;
sendBuf[3] = 0x16;
sendBuf[4] = 0x81;
sendBuf[5] = 0x0A;
sendBuf[6] = 0x00;
sendBuf[7] = 0x16;
while(*PtestChar!=NULL)
{
printf("%d\n",*PtestChar);
PtestChar++;
}
可以看出只能打印到sendBuf[5],把sendBuf[6]当成结束符了,碰到这种情况,如何才能全部打印出来呢?