I have a file with a bunch of numbers to read that i want to store in structure like a Person that has age, id and so on.
There are 2 problems. First is that each line either has one of the things like age or id or it's just white space.
Second is that i have 10 variables to fill for a structure iam using but not all of them will data for each variable in the file which is a problem because it's harder to figure out when i finished reading for the current structure.
Is there any way to go back to start of previous line? Here's input for a clearer idea:
Something random like that...Joe
1
32
Charlie
2
Chris
I was using trying with fgets and then isspace to detect white spaces but theres the problem that while iam skipping i will go to start of line of following person and i have pre condition in loop to start that in start of loop. Iam not aware of o wat to jump back to start of previous line that was read.
Thanks in advance