You may have to use doskey_vector.push_back(x) instead.Code:doskey_vector.at(j) = x;
Printable View
You may have to use doskey_vector.push_back(x) instead.Code:doskey_vector.at(j) = x;
like this?Quote:
Originally Posted by laserlight
I want to store the current value of variable x, to the vector. So every time the user types a command, the command will be stored, and the next one and so on...Code:doskey_vector.at(j) = doskey_vector.push_back(x);
Thank you
No, just use the push_back() member function.
You may want to read cppreference.com's article on vectors, and also check out SGI's Standard Template Library Programmer's Guide.
Like this:
Code:doskey_vector.push_back(x);