1
int ia[] = {0,1,2,3,4,5,6,7,8,9}; // ia is an array of ten ints
auto ia2(ia); // ia2 is an int* that points to the first element in ia
ia2 = 42; // error: ia2 is a pointer, and we can't assign an int to a pointer
這是C++ Primer上的一段代碼。有人可以向我解釋第二行是什麼意思。它是一種初始化方式嗎?我在哪裏可以找到這種初始化?我搜查了很多,但仍無法獲得相關信息。鏈接也是受歡迎的。非常感謝!這是一個數組初始化嗎?
哦,謝謝!我沒有涉及這部分。謝謝!:-) – Des1gnWizard