c++入门题目 一个HELLO,WORLD 程序 出错
来源:百度知道 编辑:UC知道 时间:2024/06/01 11:27:09
//a smallC++program
#include <inostream>
int main()
(
std::cout << "hello,world!"<< std::endl;
return 0;
)
我用VC++6.0 运行的 可是出错 出错的程序是
ompiling...
01.cpp
g:\microsoft visual studio\myprojects\p\01.cpp(2) : fatal error C1083: Cannot open include file: 'inostream': No such file or directory
执行 cl.exe 时出错.
p.exe - 1 error(s), 0 warning(s)
谢谢
//a smallC++program
#include <iostream>
int main()
(
std::cout << "hello,world!"<< std::endl;
return 0;
) 1楼的改了还是不行 谢谢 2楼的首先先谢谢你 但改了后还是出错
我的书是Accelerated C++ 里面的HELLO,WORLD 程序
#include <inostream>
int main()
(
std::cout << "hello,world!"<< std::endl;
return 0;
)
我用VC++6.0 运行的 可是出错 出错的程序是
ompiling...
01.cpp
g:\microsoft visual studio\myprojects\p\01.cpp(2) : fatal error C1083: Cannot open include file: 'inostream': No such file or directory
执行 cl.exe 时出错.
p.exe - 1 error(s), 0 warning(s)
谢谢
//a smallC++program
#include <iostream>
int main()
(
std::cout << "hello,world!"<< std::endl;
return 0;
) 1楼的改了还是不行 谢谢 2楼的首先先谢谢你 但改了后还是出错
我的书是Accelerated C++ 里面的HELLO,WORLD 程序
#include<iostream>
int main()
{
std::cout << "hello,world!"<< std::endl;
return 0;
}
如果不行,换个编译环境试试;或者干脆不要建工程,直接建一个源文件,再编译
#include <iostream.h>
int main()
{
cout << "hello,world!"<< endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
cout << "hello,world!"<< endl;
return 0;
}
必须有using namespace std;
main函数体用{ }括起来,不是( )。
第二行预处理命令#include<inostream>改为<iostream>
inostream改成 iostream