You probably need to read the input as a single line then parse it youself. You have:
is of type string
will read up to the next delimiter character, which is normally a char of type
e.g. space, tab, new-line, etc. If your input is
then, on the first read:
index = 1
attribute = "height<200.0"
opr = '2'
value = 0.0
and the file input pointer will be at the beginning of 'width' on line 2. The next attempt to read will fail to read in anything, since 'w' is not a digit, and cannot be converted to an int.
You can use
to read in a single line from the file, then, depending on how complex the input strings might possibly get, break down your input string, perhaps with
or maybe look into regex classes to help parse the string.