Hi, first post here. I am having issue with assigning a binary file line by line to objects of a class I made. Essentially its a class of SOng that has Song, artis, and size of song.
EC: Yesterday Beatles 7
Footloose Kenny Logins 3
Once done i need to overload my operators to compare the object of my SOng class, named s1 and s2.
THis is what i have so far, but I know I'm wrong since using Binary Files
while (file.peek() != eof);
if (file.peek() == eof)
while( getline( file, songInfo )
While (songInfo != '\n')
s1 = songInfo ;
if (file.peek() == '\n')
int curPos = (file.cur)
//count the number of lines read and do another while loop to read next line
I am NOT looking for perfect code, I want to figure this out for myself, I just need a little help and a point in the write direction. THanks Guys!