首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

[求助]!908jb16 C语言结构体变量定义

[求助]!908jb16 C语言结构体变量定义

device_descriptor 是结构体类型,在编译时会出现错误Error   : C2450:
const device_descriptor DeviceDesc =        //  line 4  Expected:  ; = ,
        {                                       
        sizeof(device_descriptor),
        DT_DEVICE,                       
        {0x10, 0x01},               
        0,                                       
        0,                                               
        0,                                       
        8,                                       
        {0x70, 0x0c},               
        {0x00, 0x00},               
        {0x00, 0x01},               
        1,                                       
        2,                                       
        0,                                       
        1                                       
        }; // end of DeviceDesc
不断学习,摸索中进步!
C2450: Expected: [ERROR] Description An unexpected token was found. Example void f(void); void main(void) { int i=f(void); // error: "void" is an unexpected keyword! } Tips Use a token listed in the error message. Too many nested scopes
不断学习,摸索中进步!
没有重复定义啊,编译就在第一行报错的,
结构体定义如下:
const device_descriptor DeviceDesc =
        {                                       
        sizeof(device_descriptor),
        DT_DEVICE,                       
        {0x10, 0x01},       
        0,                                       
        0,                                       
        0,                                       
        8,                                       
        {0x70, 0x0c},               
        {0x00, 0x00},               
        {0x00, 0x01},               
        1,                                       
        2,                                       
        0,                               
        1                                       
        };// end of DeviceDesc
不断学习,摸索中进步!
试过了,不对的,
不断学习,摸索中进步!
好的,已经发啦,多谢啊!
不断学习,摸索中进步!
定义了然后运行也是同样的问题啊!
不断学习,摸索中进步!
还是同样的问题啊,是不是不支持这样的定义??
不断学习,摸索中进步!
我把变量定义放在主程序里面编译通过啦!
不断学习,摸索中进步!
返回列表