I don't know much about programming to properly label the problem, but hear me out first.
I am to create a program that is to read input from a file.
The format of data from the file is as follows. 2 strings, followed by 10 integers.
<string1> <string2> <int1> <int2> <int3> <int4> <int5> <int6> <int7> <int8> <int9> <int10>
the format is the same per line, as many lines as necessary.
this part I get. Now comes error trapping.
what if somewhere along the file, one line is lacking 1 or more integers?
The code I wrote is set to read 2 strings and 10 integers per line(done using a loop), how will I skip the excess input operations if there are less than 10 integers?
-------------
A friend suggested I do a comparison if the input is of type int or of type string, but I don't know how to do that.