摘要:
//普通for循环 void test(){ int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; for (int i = 0; i < sizeof(arr) / sizeof(arr[0]); ++i){ cout << arr[i] << " "; } cou
阅读全文
posted @ 2021-05-28 20:49
阿鑫来了
阅读(70)
推荐(0)
摘要:
void test(){ int a = 10; //ra是一个引用,ra是a的别名 int& ra = a; A sa; sa.a = 1; sa.b = 1; //引用不分配新的空间 A& rsa = sa; //拷贝会分配新的空间 A copy = sa; copy.a = 5; //不会印象
阅读全文
posted @ 2021-05-28 18:35
阿鑫来了
阅读(64)
推荐(0)