协议.h
typedef struct sDevice_d
{
char name[24];
signed int (*Send)(unsigned char*, unsigned short);
signed int (*Recv)(unsigned char*, unsigned short);
} sDevice_d, *psDevice_d;
设备.c
#include "Protocol.h"
sDevice_d sDevice = { "ten", I2c_Send };
psDevice_d psDevice = &sDevice;
static signed int I2c_Send(unsigned char* buf, unsigned short len)
{
return 0;
}
在上面的代码中,我收到以下错误:
错误 C2099:初始化程序不是常量
请帮我解决这个问题。
我正在使用 Visual Studio Win32 应用程序。