c++ 使用数组语义访问元素在一个向量

From , 5 Years ago, written in C++, viewed 204 times.
URL https://pastebin.vip/view/7385db9a
  1. // 使用数组语义访问元素在一个向量
  2. #include <vector>
  3. #include <iostream>
  4.  
  5. int main() {
  6.         std::vector<int> vecDynamicIntegerArray(4);
  7.  
  8.         // Copy integer values into individual element locations
  9.         vecDynamicIntegerArray[0] = 50;
  10.         vecDynamicIntegerArray[1] = 1;
  11.         vecDynamicIntegerArray[2] = 987;
  12.         vecDynamicIntegerArray[3] = 1001;
  13.  
  14.         std::cout << "The vector contains ";
  15.         std::cout << vecDynamicIntegerArray.size() << " Elements";
  16.  
  17.         return 0;
  18. }
  19.  

Reply to "c++ 使用数组语义访问元素在一个向量"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website