我在这里读到这是 xcode 中最烦人的错误之一,请帮忙: 我有一个 C 代码,可以在 Android 上编译并运行,但不能在 iOS 上运行:
.h 文件:
typedef int (*encoding_function)(const short * a_input, unsigned char * a_output, const int a_len);
typedef int (*decoding_function)(unsigned char * a_input, short * a_output, const int a_len);
void set_encoding_func(encoding_function a_encoding_func);
void set_decoding_func(decoding_function a_decoding_func);
第一个c文件:
decoding_function real_decoding_func;
void set_decoding_func(decoding_function a_decoding_func)
{
real_decoding_func = a_decoding_func;
}//- HERE IS THE ERROR!!!!!
第二个 c 文件 - 没有错误!!!
encoding_function real_encoding_function;
void set_encoding_func(encoding_function a_encoding_func)
{
real_encoding_function = a_encoding_func;
}
编辑:删除代码后,我收到错误“Expected unqualified-id”。
最佳答案
我的代码没有出现任何错误。 检查您是否包含头文件。
关于c - 预期标识符或 '(' XCode C 指针函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36532430/