Hello. I created a program that will create a file and print a list on it.
Here is the code for my program:
Code:
int controlvalue(void) {FILE *controlvalue;
controlvalue = fopen("something.txt", "a+");
/* Series of fprintfs */
fclose (controlvalue);
return 1;
}
Here is an example list created by my program:
Code:
[Gifts]
Candy=45
Chocolate=32
Toy=128
Robot=754
Doll=1492
Star=21
Phone=72
Skateboard=87
Frame=314
Days=365
Perfume=421
I want to get the value of "Skateboard" on file. So I need to read 9 lines. On the 9th line, the gets() loop will stop. But, what if I only want to get the value of "Skateboard" as integer (87) and not a string? Also, is it possible to scan the value of Skateboard if it's located on a different (or unknown) line?
Thanks in advance!