错误 1 error LNK1561: 必须定义入口点 D:\Tm\Project6\Project6\LINProject6 我用的是 VS2013
局部变量#include<iostream>usingnamespacestd;voidswap(int,int);intmian(){intx=3,y=4;cout<<...
局部变量
#include<iostream>
using namespace std;
void swap(int, int);
int mian()
{
int x = 3, y = 4;
cout << "在mian函数中,调用swap函数之前,X的值为:" << x << ",y的值为:" << endl;
swap(x, y);
cout << "在main函数中,调用swap函数之后,x的值为:" << x << ",y的值为:" << endl;
return 0;
}
void swap(int x, int y)
{
cout << "在swap函数中,调用swap函数之前,x的值为:" << x << ",y的值为:" << endl;
int z;
z = x;
x = y;
y = z;
cout << "在swap函数中,调用swap函数之后,x的值为:" << x << ",y的值为:" << endl;
} 展开
#include<iostream>
using namespace std;
void swap(int, int);
int mian()
{
int x = 3, y = 4;
cout << "在mian函数中,调用swap函数之前,X的值为:" << x << ",y的值为:" << endl;
swap(x, y);
cout << "在main函数中,调用swap函数之后,x的值为:" << x << ",y的值为:" << endl;
return 0;
}
void swap(int x, int y)
{
cout << "在swap函数中,调用swap函数之前,x的值为:" << x << ",y的值为:" << endl;
int z;
z = x;
x = y;
y = z;
cout << "在swap函数中,调用swap函数之后,x的值为:" << x << ",y的值为:" << endl;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询