Vectors in C++ ->Watch this for FUN - Funny job interview Are you getting bored with online lectures? ->Watch this - When online lectures are boring Vectors in C++ are a sequence container class that implements the dynamic size of the array to store things without caring for its size. ****** Array vs Vectors An array although is a static allocation where size is fixed, but in Vectors, the size is not fixed due to its dynamic nature. ***** Declaration of Vectors std:: vector<int> vec; //under #include<vector> library ***** Important functions of vectors are: emplace() ->vec.emplace(position,value) inserts the value at the specified position. emplace_back() ->vec.emplace_back(value) inserts the value at the end of the vector. insert() ->vec.insert(position,value) inserts the value at the front of the position given in the function. resize() ->vec.resize(value), resizes the vector's size to the value. reserve() ->vec.reserve(...
Hey guys! Have you checked this awesome blog to learn computer science subjects? This blog would make you learn the important topics in Computer science, get subscribed for learning more!!!!