offsetof(t_msg_parameter, sc_info);
t_msg_parameter是结构体名,sc_info是前面结构体的成员,是个结构体数组类型,以前用gcc4.4.7可以编译过,现在用gcc7.3.0编译失败,出以下错误,看offsetof用法成员不用声明啊,哪位大神知道什么原因。
error: expected primary-expression before ',' token
error: 'sc_info' was not declared in this scope
error: 'offsetof' was not declared in this scope
这应该是缺少头文件包含吧,offsetof和sc_info,编译器不认识了。
贴全代码
error: expected primary-expression before ',' token
感觉你应该是在不该写分号的地方写了分号,或者该写的地方没写,或者括号不配对
题主有用要采纳的或者不采纳系统结也行。不要偷偷自己结^_^