Reading lines from a File
This is an insanely simple problem I'm sure. I started a c++ class with no c++ history and only java. The class started out in recursion and I've been struggling through it. I have one day to finish a program and e-mail it in and no time to talk to the teacher so I am in a dire situation. I have coded a program called Set which will uses a linked list to override the operators such as + - * += ==, etc. I get a file with varying lines that will appear as, {1,3,5,7} + {1,2,9} or {4,5,9} + {3,5} - {9}. I'm having trouble finding a way to read through multiple lines and reading the various characters into the Set class. I coded a small function to read one set section but I can't even compile it to check if it would work. Regardless, I am a complete beginner so don't assume I know anything.
Code:
void Set::readFromFile(ifstream myFile)
{
int value;
char seperator;
while (! myFile.peek()=="}")
{
myFile >> value >> seperator;
insert(myList.getLength()+1,value);
}
}