'stdafx.h'头文件打开问题
在编译的过程中,每次将'stdafx.h'添加后,都出现以下出错信息“fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory执行 cl.exe 时出错.”
当我把这个头文件给删除后,调试、运行都是没有问题的。谁能详细解释一下原因?有什么解决办法?
程序代码:#include"stdafx.h"
#include<iostream.h>
void Swap(int &a,int &b);
void Swap(int &a,int &b)
{int t;
t=a;a=b;b=t;}
int main(int argc,char*argv[])
{int x=8,y=10;
cout<<"x="<<x<<" y="<<y<<endl;
Swap(x,y);
cout<<"x="<<x<<" y="<<y<<endl;
cin>>x;
return 0;
}
这是一个其中的例子[ 本帖最后由 燕过风 于 2010-5-17 17:55 编辑 ]








