Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

vector::at() || Finding element with given position using vector in C++

// CPP program to illustrate
// Implementation of at() function
#include <iostream>
#include <vector>
using namespace std;
 
int main()
{
    vector<int> myvector;
    myvector.push_back(3);
    myvector.push_back(4);
    myvector.push_back(1);
    myvector.push_back(7);
    myvector.push_back(3);
    cout << myvector.at(3);
    return 0;
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Finding #element #position #vector
ADD COMMENT
Topic
Name
3+4 =