我的一个cpp文件内容如下:main () [
double p[2] = {5.0, 9.0};
printf("It is %f",p[1]);
int i;
}运行后给出下面的错误信息:
Compiling...
text.cpp
c:\documents and settings\administrator\桌面\x\text.cpp(2) : error C2144: syntax error : missing ']' before type 'double'
c:\documents and settings\administrator\桌面\x\text.cpp(2) : error C2090: function returns array
c:\documents and settings\administrator\桌面\x\text.cpp(2) : error C2144: syntax error : missing ';' before type 'double'
c:\documents and settings\administrator\桌面\x\text.cpp(2) : error C2501: 'main' : missing storage-class or type specifiers
c:\documents and settings\administrator\桌面\x\text.cpp(2) : fatal error C1004: unexpected end of file found
Error executing cl.exe.text.exe - 5 error(s), 0 warning(s)我无法检查出哪里出错了,请帮忙。谢谢!
double p[2] = {5.0, 9.0};
printf("It is %f",p[1]);
int i;
}运行后给出下面的错误信息:
Compiling...
text.cpp
c:\documents and settings\administrator\桌面\x\text.cpp(2) : error C2144: syntax error : missing ']' before type 'double'
c:\documents and settings\administrator\桌面\x\text.cpp(2) : error C2090: function returns array
c:\documents and settings\administrator\桌面\x\text.cpp(2) : error C2144: syntax error : missing ';' before type 'double'
c:\documents and settings\administrator\桌面\x\text.cpp(2) : error C2501: 'main' : missing storage-class or type specifiers
c:\documents and settings\administrator\桌面\x\text.cpp(2) : fatal error C1004: unexpected end of file found
Error executing cl.exe.text.exe - 5 error(s), 0 warning(s)我无法检查出哪里出错了,请帮忙。谢谢!
解决方案 »
- 安装一个msi文件出现奇怪的错误
- 大家来看看这道选择题咯。
- 不能将已定义的类添加到MFC工程
- 我创建了一个线程packet,为什么在其他类中向他发送线程消息,却接收不到,但第一个消息怎么发都收得到,第二个消息死活也收不到
- 在CAsyncSocket中实现多客户端中,当客户端断开连接后,服务端怎样才知道呢?
- 500大洋求两幅图象过渡的程序代码.
- 取得CListCtrl重的一行数据,如何转换到结构体或类对象啊
- 如何让鼠标移动到某菜单项的时候,不是显示一条蓝色,而是让它象ofice2003中那样的效果??(用代码实现,不用其他的控件)
- 为什么主 DIALOG 上一有 RICHEDIT 控件,程序就无法启动?
- 在Win32 release下,执行程序很少一部分就出现编译器关闭现象,,但是在Win32 Debug下是不出问题的
- 关于GetNextPathName的一个很困惑的问题
- 【转】肖艳琴的遗书
笔误?
printf("It is %f",p[1]);
int i;
}很明显 怎么会找不到错误呢 注意头文件不要让他去睡觉
大神!
double p[2] = {5.0, 9.0};
printf("It is %f",p[1]);
}