标签:class com pre style span blog ges 地址 src
int main() { int k = 12;//整数k,地址为x00CFFCA4 int &c = k;//引用参数c,c及&c的值与k及&k相同 int *w = &k;//指针参数指向k的地址,其本身地址为x00CFFC8C,指向k的地址为x00CFFCA4 *w = 13; cout << "k1 = " << k << " *k1 = " << &k << endl; cout << "w = " << w << " *w = " << &w << endl; cout << "c = " << c << " *c = " << &c << endl; cout << "k2 = " << k << " *k2 = "<< &k << endl; system("pause"); return 0; }
【应用举例】引用形参函数可避免不必要的拷贝。
标签:class com pre style span blog ges 地址 src
原文地址:http://www.cnblogs.com/liez/p/6877945.html