我有一个源代码,其中有一个计算周校验和的函数。我需要传递一个字符数组,比如说“ Hello World ”。我怎样才能做到这一点??我尝试了一些方法,例如:
char textArr[] = 'hello world'
但我收到“ undefined reference ”错误。
unsigned int rs_calc_weak_sum(void const *p, int len) {
unsigned char const *buf = (unsigned char const *) p;
}
请帮我解决这个问题。
最佳答案
确保您的函数 rs_calc_weak_sum 在 main 之前原型(prototype)化/定义。
关于c - 将 char 数组传递给 (void const *p),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18086826/