If I have a vector of class vector<constructor> name;
The constructor consists of some number of elements constructor(string a, string b, string c, string d): aeh(a), bee(b), cee(c), dee(d)
How would I construct a cin to read only a few of the elements
for instance if I only want to push back a and b and leave c/d etc. empty for later input using a different command
Right now the input code is:
1 2 3
constructor x;
cin>>x;
name.push_back(x);
but I am required to input four strings when I only want to input two
Any suggestions?
Database dtb;
Personal p1;
cin>>p1;
dtb.addstudent(p1);
The problem is for the program to proceed from cin to the add student function it needs four strings. Hope that clears things up.
If your given solution from above is still the same, then I will try that. I am not sure actually how to pass in empty strings though? Maybe its the wording that has got me
How are you even declaring a vector of Personal if Personal is not default constructable?
And the way you are describing the problem, it sounds like a Catch-22. You make it sound like "I need the four strings to construct the object and run the method, but I can't get all four strings without constructing the object and running the method."