我有一个实现对 EEPROM 的写入操作的 API。这是它的声明:
CYBLE_API_RESULT_T CyBle_StoreAppData (uint8 * srcBuff, const uint8 destAddr[], uint32 buffLen, uint8 isForceWrite);
当我调用此函数并向srcBuff其发送已声明为uint8类型的数组参数时,它运行良好。
问题是,我需要向char它发送数组指针。我在想这char已经是一个uint8,但是如果我char向该函数发送一个数组指针而不是uint8. 为什么我不能使用char而不是uint8?以下是调用该函数的 2 个示例:
static const uint8 datastack_ROM[dedicatedRomSize] = {0};
uint8 Container_ID[10];
char Prefix[10];
//Call the function with Container_ID which has been declared as uint8. This is working.
CyBle_StoreAppData(Container_ID,datastack_ROM,10,0);
//Call the function with Prefix which has been declared as char. This is NOT working.
CyBle_StoreAppData(Prefix,datastack_ROM,10,0);
这是第二次调用的警告:
passing char[10] to parameter of type 'uint8 *' converts between pointers to integer types with different sign.
不是char和uint8一样吗?