#include<stdio.h>
void swape(int &a,int &b)
{
int t;
t=a;
a=b;
b=t;
}
void swape(float &a,float &b)
{
float t;
t=a;
a=b;
b=t;
}
int main()
{
int a=1,b=3;
float c=4.5,d=5.3;
swape(a,b);
swape(c,d);
printf("%d %d\n",a,b);
printf("%.2f %.2f\n",c,d);
return 0;
}
------解决方案--------------------------------------------------------
C连引用都没。你不用C++编译器就算不用函数重载也过不了编译。能过只能说明一点,你用了C++编译器
------解决方案--------------------------------------------------------
你把文件后缀名改成 .c ,再重新编译,你就知道差别了,C里面还没有引用呢
