开发者

Copy unsigned char array

What would be the best way to copy unsigned char array to another?

For example:

unsigned char q[1000];
unsigned char p[1000];
开发者_StackOverflow中文版
strcpy (q,&p);

The above code does not work, it gives me error saying "cannot convert parameter 1 from unsigned char [1000] to char *".


As indicated by its name, strcpy works on C string (which a unsigned char array is not).

You should consider memcpy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜