标题:求助 c语言结构体赋值 编译报错 syntax error : '{'
取消只看楼主
zhht87
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2013-8-7
结帖率:57.14%
 问题点数:0 回复次数:2 
求助 c语言结构体赋值 编译报错 syntax error : '{'
如题, 结构体赋值的程序如下,编译的时候提示对con[24]赋值的句子出错  syntax error : '{'   求大神帮助修改
int main()
{
struct convert
 {double C[3][3];};
 struct convert con[24]={{1,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0},{0.0,0.0,-1.0,0.0,-1.0,0.0,-1.0,0.0,0.0},{0.0,0.0,-1.0,0.0,1.0,0.0,1.0,0.0,0.0},{-1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,-1.0},{0.0,0.0,1.0,0.0,1.0,0.0,-1.0,0.0,0.0},{1.0,0.0,0.0,0.0,0.0,-1.0,0.0,1.0,0.0}{1.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,-1.0}{1.0,0.0,0.0,0.0,0.0,1.0,0.0,-1.0,0.0},{0.0,-1.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0},{-1.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,1.0},{0.0,1.0,0.0,-1.0,0.0,0.0,0.0,0.0,1.0},{0.0,0.0,1.0,1.0,0.0,0.0,0.0,1.0,0.0},{0.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0},{0.0,0.0,-1.0,-1.0,0.0,0.0,0.0,1.0,0.0},{0.0,-1.0,0.0,0.0,0.0,1.0,-1.0,0.0,0.0},{0.0,1.0,0.0,0.0,0.0,-1.0,-1.0,0.0,0.0},{0.0,0.0,-1.0,1.0,0.0,0.0,0.0,-1.0,0.0},{0.0,0.0,1.0,-1.0,0.0,0.0,0.0,-1.0,0.0},{0.0,-1.0,0.0,0.0,0.0,-1.0,1.0,0.0,0.0},{0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,-1.0},{-1.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0},{0.0,0.0,1.0,0.0,-1.0,0.0,1.0,0.0,0.0},{0.0,-1.0,0.0,-1.0,0.0,0.0,0.0,0.0,-1.0},{-1.0,0.0,0.0,0.0,0.0,-1.0,0.0,-1.0,0.0}};
return 0;
}
搜索更多相关主题的帖子: convert double 结构体 c语言 
2013-08-07 18:04
zhht87
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2013-8-7
得分:0 
回复 2楼 liufashuai
果然通过了,是最后一个元素少了逗号吗?
2013-08-07 18:28
zhht87
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2013-8-7
得分:0 
回复 4楼 liufashuai
好吧 还在初学阶段 多谢!
2013-08-07 18:34



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-418759-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.205829 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved