![]() |
#2
幽园香客2010-05-17 21:49
|
执行 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;
}
这是一个其中的例子#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 编辑 ]