Hello I have the following code:
const int arraySize = 5;
int indexOfArray = 0;
int tempPrice;//temporary stores price
string tempStr;//temporary stores author, title
ifstream inFile ("master8.txt");
while (! inFile.eof() )
for(int x=0; x<1; x++)
bookList[x].getName = getline(inFile, tempStr, ' ');
cout << "\n\nI " << x << endl;
else cout << "ERROR";
So I have the code above that is supposed to store a name inside bookList[x].getName. I will then be taking whatever X is and writing it to an outfile. The problem is that right now the name can be anywhere from 1-20 characters. I will then be grabbing an ID #, and a bunch of other things and doing the exact same thing with it.
Right now my code does not compile.
Here is the getName function inside the header file
string Employee::getName(string &name)