I'm trying to write a program that takes inputData from two files for a season of some sport (i.e.: football) and writes an output listing rankings each week. In the input file with the scores for each game, every week is separated by a line of '-' characters. I have an if, else loop set up where the program peeks at the first character of each line. If it sees a character other than '-', it reads normally. However, when it reads '-', the program will begin the output cycle.
The thing is, being that this is peek, I need to figure out how to get to the next line without creating new input and not cause a crash. All I can think of is using inStream.find( !'-' );
or inStream.seekg( !'-' );
. Are there any other options I can use?
Also, for reference, the code is listed here: https://coderpad.io/475356. Look for line 80 for the problem area. Just don't make any edits please.
Thank you for your time.
P.S.: If anyone can find any other crashes, though, feel free to mention it.