I was searching through the various posts regarding vectors and didn't see exactly what I was looking for, so...
What I was wondering is how (if this is even possible) you can put the contents of a regular variable into a vector? For example, pretend I am doing the following (assuming I include the correct header files):
Based on this, is there a way that I put the contents of SomeData into the vector named VectorData? I thought that you could perhaps do this with the vector's "insert" property (i.e. VectorData.insert(SomeData) ) , but that doesn't seem to work. Am I attempting to do something that is not possible or is it a simple case or user error? Any help that someone could provided would be much appreciated.Code:cout << "Enter some data => "; char SomeData; cin >> SomeData; // Declaring an empty vector vector<char> VectorData;
Thanks, as always!