Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Vec+Mem+Adv_11
//g++ 5.4.0 #include <iostream> #include <vector> using namespace std; int main() { //Below either way is good for vector intialisation //vector<string> strings(5); vector<double> numbers(20); cout << "Size:" << numbers.size() << endl; int capacity = numbers.capacity(); cout << "Capacity:" << capacity << endl; for(int i = 0; i<10000; i++){ if(numbers.capacity() != capacity){ capacity = numbers.capacity(); cout <<"Capacity:" << capacity << endl; } numbers.push_back(i); } for(int i=0; i< numbers.size(); i++){ cout << numbers[i]<<endl; } return 0; }
run
|
edit
|
history
|
help
0
fb_series
Zahra_matrix
3
wealth of banks
Making pyramid using nested loop 2/2
Shared lock
Funny Saying
point to a rvalue
merge without extra space Gap method ALgorithm
Microsoft - # of fragments (optimised)