Visual stuio2005 编译C++问题

来源:百度知道 编辑:UC知道 时间:2024/05/18 05:41:21
#include<stdasfx.h>
#include<iostream>
using namespace std;
void main()
{
int a;
cin<<a<<endl;
cout<<a<<endl;
}
为什么编译时候有个错误为什么我用的是Visual studio2005 高手帮帮忙````

头文件那,#include<stdasfx.h> 写错了,改stdafx
不过你这程序没有用到,删了算了

输入的那里cin>>,方向反了。
还有。用".h"就别用using namespace std;

用using namespace std;就别用“.h”
用一个就一个,别两个都用

#include<stdasfx.h>
换成#include "stdafx.h"或#include<stdafx.h>或直接注释掉

#include<stdafx.h>
#include<iostream>
....
cin>>a>>endl;
cout<<a<<endl;
..

不要点H,就0K