+ 1
How can i get data by keyboard using push_ back?
I have to make a program that asks for user data and store them using push_back. A little help please!!! Using c++.
2 Answers
+ 6
The push_back operation is supported by STL containers like vector, list, queue and stack. The best thing to use for this case would be a vector.
Use a loop to keep reading a character till the input stops or fails, and push_back the character into a vector of characters.
As for the code, try making it yourself now, and let us know if you get stuck. We will be happy to help.
+ 2
Thanks!!! I'll try that.