I am trying to create an empty vector inside a loop and want to add an element to the vector each time something is read in to that loop.
#include
Use push_back:
while(cin >> x) myVector.push_back(x);
The insert function takes an iterator as the first argument, indicating the position to insert.
Also, you need to get rid of the parentheses in the declaration of myVector:
myVector
std::vector myVector;