I'm currently working on a program that's supposed to read data from a text file, and place said data in a linked list. I've got a pretty good idea of what I'm doing, but the thing is I'm supposed to include error handling that jumps to the next line if there is any errors in the data format in the file.
The file contains information about a number of terminators in the form of their model and their serial number.
An example of the data that can be read is:
TERMINATOR T-800 1
TERMINATOR T-1000 2
TERMINATOR T-800 3
TERMINATOR T-800 4
In the first row above, T-800 is the model, and 1 is the serial number. The four rows above are all valid, but if the fifth row would look something like this:
TORMONUTTUR T-800 1h6
or:
abc 2
, the data should be discarded and the program should continue reading the next row.
I'm currently lost on this, and would appreciate just a nod in the right direction, since I'm not sure how I should even begin with this problem.