khizaraq, on 1 Feb, 2010 - 07:57 AM, said:
I saw the post, this is my definition prototype
void getInput(contact *, ifstream);
Now you are saying I should use
void getInput(contact *myContacts[], ifstream);
Right?
But what if I do not wish to put a variable name there?
NickDMax, on 1 Feb, 2010 - 08:01 AM, said:
void getInput(contact *myContacts, ifstream fin)
the first argument should probably be
contact &myContacts in C++ - try to avoid using pointers if you can use a reference.
Secondly ifstream should be passed by reference. these objects (the i/o streams) do not copy well (I have crashed many a program over trying to pass cin/cout by value -- and it takes FOREVER to figure out what is wrong).
void getInput(contact &myContacts, ifstream &fin)
Edit well -- at least pass fin by reference...
Ok wil be sure to pass fin by reference

New Topic/Question
Reply





MultiQuote



|