标题:'stdafx.h'头文件打开问题
取消只看楼主
燕过风
Rank: 2
等 级:论坛游民
帖 子:19
专家分:10
注 册:2010-4-9
结帖率:85.71%
已结贴  问题点数:5 回复次数:0 
'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 编辑 ]
搜索更多相关主题的帖子: 文件 stdafx 
2010-05-17 17:51



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-307046-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.084279 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved