If it helps, i've singled out the save function and it saves normally, and i've also singled out the QuestsAndAnswers getVar functions and they work as well.. It just doesn't save to the text file when run together though.
In your SaveToFile() method, the QuestsAndAnswers object is local to your function and has nothing in it. You should pass a reference of your class to that function from where ever you fill the QnA object..
I tried newbieg's code but now i get stuck with another error,
C:\Users\Derv\Desktop\Census\Save.cpp|11|error: prototype for 'void Save::SaveToFile(QuestsAndAnswers&)' does not match any in class 'Save'|
then.. i attempt to make the prototypes match by doing this,
1 2
void Save::SaveToFile(QuestsAndAnswers &QnA);
in the Save.h file but, i get hit with twwo errors which i dont understand /:
C:\Users\Derv\Desktop\Census\Save.h|8|error: 'QuestsAndAnswers' has not been declared|
C:\Users\Derv\Desktop\Census\Save.h|8|error: extra qualification 'Save::' on member 'SaveToFile' [-fpermissive]|
and what do you mean it contains no "state"? I'm new the whole c++ class thing
Your prototype is within your save class which is inside of the header, correct?
So look at the other prototypes, they do not need the extra save:: qualifyer.