如下:
/**/
/*关于引用类型返回值之函数的使用*/
#include < iostream >
using namespace std;
int g = 0 ;
int & func() ... {
return g;
}
void main() ... {
int t=func();
cout<<t<<endl;
func()++;
cout<<g<<endl;
func()=30;
cout<<g<<endl;
}
#include < iostream >
using namespace std;
int g = 0 ;
int & func() ... {
return g;
}
void main() ... {
int t=func();
cout<<t<<endl;
func()++;
cout<<g<<endl;
func()=30;
cout<<g<<endl;
}