Menu

Someone Break Code Line Line Tell Line Means Int Readbooks String Filename String Titles S Q43794675

Can someone break down this code line by line for me and tell mewhat each line means?

int readBooks(string filename, string titles[], stringauthors[],int currentSize,int maxCapacity){

ifstream inFile(filename.c_str());

if(!inFile){

return -1;

}

string line;

int size=currentSize;

while(getline(inFile,line) && size<maxCapacity){

istringstream stream(line);

string token; //to represent a single token

getline(stream,token,’,’);

authors[size]=token;

  

getline(stream,token,’,’);

titles[size]=token;

size++;

}

inFile.close();

return size;

}

Expert Answer


Answer to Can someone break down this code line by line for me and tell me what each line means? int readBooks(string filename, st…

OR