我有:
unsigned char *programBinary = (unsigned char) malloc(binarySize);
但我收到以下错误:
test.c:127:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
test.c:127:33: error: invalid type argument of unary ‘*’ (have ‘int’)
这对我来说是相当新的,所以我不确定如何解决这个问题。
最佳答案
您需要转换 (unsigned char*)
而不是 (unsigned char)
关于c - 在 C 中转换指针时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19988841/