首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

c++低级有关问题求指教

2012-04-08 
c++低级问题求指教# include iostream# include iomanip.husing namespace stdint main(){couthhh

c++低级问题求指教
# include <iostream>
# include <iomanip.h>
using namespace std;
int main()
{
cout<<"hhhhh"<<setw(8)<<"boqu"<<endl;
return 0;
}
为什么提示错误?

[解决办法]
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
cout<<"hhhhh"<<setw(8)<<"boqu"<<endl;
return 0;
}

[解决办法]

探讨

谭老师的书上写的头文件是#include<iomanip.h>,为什么现在要去掉.h?

[解决办法]
这是正道的
探讨
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
cout<<"hhhhh"<<setw(8)<<"boqu"<<endl;
return 0;
}

[解决办法]
二楼正解。C++里面的库文件都是无“.h”这是新标准。哪怕是属于C语言的库文件也不带。最多添加“c”如
"string.h"==>"cstring"等。谭老师那个年带还没这标准。所以也不要过分苛责他。

热点排行