读书人

阿 这样的有关问题也有实在的想不通阿

发布时间: 2012-02-15 12:09:44 作者: rapoo

请高手看看阿 这样的问题也有实在的想不通阿
请看看才这几句代码就出错了 
错误1fatal error C1083: Cannot open include file: 'iostream.h ': No such file or directorye:\zhangmeiproject\zmvc\point\point\point.cpp1


#include <iostream.h>

struct Point
{
int x;
int y;
};
void main()
{
Point pt;
pt.x = 5;
pt.y = 5;
cout < <pt.x < <endl;
}

请问这是什么原因?要如何解决呢?

[解决办法]
#include <iostream>

using namespace std;

struct Point
{
int x;
int y;
};
int main() // 不要用void 返回,标准不容许~
{
Point pt;
pt.x = 5;
pt.y = 5;
cout < <pt.x < <endl;
return 0;
}


#include <iostream>

struct Point
{
int x;
int y;
};
int main() // 不要用void 返回,标准不容许~
{
Point pt;
pt.x = 5;
pt.y = 5;
std::cout < <pt.x < <std::endl;
return 0;
}

两个试试~

读书人网 >C++

热点推荐