Hey everyone. I'm having a problem passing my struct into my class member function. I feel it's redundant to have a structure in both the class and the main program. I'm reading from my book how to pass the structure into functions, and figured it should be the same to pass it into class functions, but I'm getting an error that I just cannot figure out. Here's a snippet of the code.
constint SIZE = 75; //Constant into to hold the size of the findName variable.
longint position; //Holds the read/write position of the file.
char findName[SIZE],//Variable used for user-defined search key.
ans; //Holds the user's input for navigating program.
string input; //Gets input for each item from the user.
cout << "Would you like to add a new entry? Y or N: ";
cin >> ans;
while(toupper(ans) == 'Y')
cout << "\n****************NEW ENTRY*********************\n\n";
cout << "NAME: ";
cout << "ADDRESS: ";
cout << "CITY: ";
cout << "STATE: ";
cout << "ZIP: ";
cout << "PHONE: ";
cout << "ACCOUNT BALANCE: $";
cin >> customer.acctBal;
cout << "DATE OF LAST PAYMENT: ";
This is the error I'm getting :
1 2 3
records.cpp(9): error C2511: 'void Records::writeInfo(const Info &)' : overloaded member function not found in 'Records'
records.h(32) : see declaration of 'Records'
Thanks! I will do. It seems like a pain to do binary.. I did it for the plain fact that I want to get it under my skin before I decide to stay away from it. First time ever using the binary open mode.. I have my program working, just not separated in classes yet and this code is still giving me problems even after the changes.
JLBorges, you are an awesome person! Turns out the different files were my problem. I deleted all the files that were in the directories and replaced them with the updated ones, and it fixed it! Thanks so much. I'm so happy...