|
아래의 프로그램에서 입력을 0x01, 0x02, 0x03, 0x00, 0x04, 0x05 이렇게 하고
memcpy 하면 0x03 까지만 메모리 복사가 되고, 0x00 이후부터는 잃어버립니다.
0x00 을 포함하여 복사를 할수 있는 방법이 없을까요....?
//===================================================================
strTmp = "0x01, 0x02, 0x03, 0x00, 0x04, 0x05";
while(exist_0x)
{
iPos = NULL;
iPos = strstr(strTmp.c_str(), "0x");
if(iPos)
{
Qdata[count].IMG[i]=NULL;
result = iPos - strTmp.c_str() + 1;
image[i] = StrToInt(strTmp.SubString(result, 4));
//if(image[i]==0)
//ShowMessage(image[i]);
strTmp = iPos+6;
i=i+1;
}
else {
exist_0x = FALSE;
}
}
memcpy((char *)Qdata[count].IMG, image, i);
exist_0x = TRUE;
image[0]=0;
//===================================================================
부탁드립니다.
|