将src字节数组从第offset的位置的后面count个转换成一个字符串
awjx 2005-09-23 01:57:11
我设计了如下函数,将src字节数组从第offset的位置的后面count个转换成一个字符串,但执行在CString内部断言失败?怎么回事?
CString Convert::BytesToString(BYTE *src, int offset, int count)
{
CString str ;
for(int i = 0; i<count; i++)
{
str.SetAt(i, str[ offset + i ]);
}
return str;
}
这个函数有问题吗?
为什么我试着执行 str.SetAt(i,'8');都不行?不会SetAt有错吧?