This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

c2000处理器在执行标准c函数malloc、memcpy等函数时size问题



由于c2000系列处理器最小存储单元是16bit,所以sizeof(int)=1,sizeof(byte)=1。 那么在执行stdlib.h、string.h中的函数时,函数参数size_t 是按照byte(8 bits)长度得到的数量还是按照int(16bits)长度得到的数量?

例如:1、malloc(2) 是分配一个地址(16bits)的空间,还是分配两个地址的空间?

2、UINT16 a,b;

      memcpy(b,a,2)、memcpy(b,a,sizeof(a))、memcpy(b,a,1)哪种方法正确