push back only part of vector

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?
I'm not exactly sure I understand the problem. Couldn't you pass in empty strings for those arguments if you want to leave them alone?
To add a bit of information to the above
this is more of the code
So the constructor is 4 strings long

 
Personal::Personal(string a, string b, string c, string d): fn(a), ln(b), db(c), g(d) {}


 
vector<Personal> students;



1
2
void Database::addstudent(Personal p){
	students.push_back(p);}



main.cpp includes database.h and personal.h
1
2
3
4
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."
Here is that
1
2
3
4
5
class Personal {
public:
	Personal() {;}
	Personal(string fn, string ln, string i, string dob, string g, string ht, string la, string c, string m);
}


I was trying to use the addstudent function to push back in to a vector but I can try something else
I did some re-arranging and changed a few things and got it all set and working, thanks for the help though!
Topic archived. No new replies allowed.