Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to Add to an Array

#include <vector>
#include <iostream>

int main() {
  std::vector<int> v;
  v.push_back(42);

  std::cout << v.size() << "
";
  std::cout << v.back() << "
";
}

Output:
1
42
Source by cppbyexample.com #
 
PREVIOUS NEXT
Tagged: #How #Add #Array
ADD COMMENT
Topic
Name
1+2 =