vector<int>&a
时间: 2023-09-25 16:15:20 浏览: 100
引用中提到了一种方法,可以通过将一个vector赋值给另一个vector来创建一个新的vector。例如,使用vector<int> a = b;这种方式可以将vector b的所有元素赋值给vector a。这样,a和b将引用相同的内存空间,它们将共享相同的元素。所以,vector<int>& a 是指一个引用,它指向另一个vector<int>类型的变量。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [C++中vector<vector<int> >的用法](https://blog.csdn.net/Y1730008223CONG/article/details/123821901)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [C++-STL-vector:vector的初始化【vector<int> a】【vector<int> a(7)】【vector<int> a(7,3)】...](https://blog.csdn.net/u013250861/article/details/128088256)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文