Search
 
SCRIPT & CODE EXAMPLE
 

CPP

how to fill vector from inputs c++

#include <iostream>
#include <vector>
using namespace std;

int main()
{
  vector<int> a;
  int SIZE = 5;
  
  for(int i = 0; i < N; i++)
  {
    int tmp;
    cin >> tmp;
    a[i] = tmp;
  }
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: vector::at() || Finding element with given position using vector in C++ 
Cpp :: intlen in c++ 
Cpp :: ue4 int to enum c++ 
Cpp :: how to print items in c++ 
Cpp :: google test assert throw 
Cpp :: how to pass an array by reference in c++ 
Cpp :: find maximum sum in array of contiguous subarrays 
Cpp :: how to create an integer in c++ 
Cpp :: modular exponentiation algorithm c++ 
Cpp :: C++ detaching threads 
Cpp :: statements 
Cpp :: STD::ERASE FUNCTION IN C++ 
Cpp :: how to find size of int in c++ 
Cpp :: runtime 
Cpp :: minimum characters to make string palindrome 
Cpp :: c++ function pointer 
Cpp :: stack data structure c++ 
Cpp :: assign value to a pointer 
Cpp :: how to set arrays as function parameters in c++ 
Cpp :: remove elements from vector 
Cpp :: . The cout with the insertion operator (<<) is used to print a statement 
Cpp :: pthread c++ example with output 
Cpp :: even or odd program in c++ 
Cpp :: c++ file handiling 
Cpp :: c++ get microseconds since epoch 
Cpp :: c++ vector move element 
Cpp :: c++ restrict template types 
Cpp :: coin change top-down 
Cpp :: convert datatype of field db browser from text to timedate db browser 
Cpp :: how to point to next array using pointer c++ 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =