Increase vector with while loop
I want to be able to have the numberSorting.at increase with each loop, but I can't figure out how to do that. Any suggestions?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#include "pch.h"
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int amountNum;
int i = 0;
int main()
{
cin >> amountNum;
vector<int> numberSorting(amountNum);
while (i < amountNum) {
cin >> numberSorting.at();
i++;
}
return 0;
}
|
numberSorting.at(i)
Thank you!
Topic archived. No new replies allowed.