传递指针参数问题
tomew 2008-03-23 04:51:39 unsigned char b[5] = {0x35,0x17,0x21,0x90,0x81};
unsigned char time[2] ={0x32,0x30};
FormatOneCmd(b,0x70,2,time);
bool FormatOneCmd(const unsigned char* CarId,const unsigned char Type ,const unsigned char Length ,
const unsigned char* Content)
{
if (Content)
{
int ContentLength=strlen((char*)Content);
if ( ContentLength != Length || Length>255 || ContentLength >255 )
return false ;
}
else
{
if (Length!=0)
return false ;
}
}
为什么我传过来之后,ContentLength != Length