I wrote a program which stores a lot of informacion in a file, but now I have a problem I want to read out information from the file but not all only some of then
Pleas Help me!!
I wrote a program which stores a lot of informacion in a file, but now I have a problem I want to read out information from the file but not all only some of then
Pleas Help me!!
It is a text file
I don't think it's wise to use fseek (jump to a certain position in the file) when using text files.
The best way to do this is by reading all lines from the file (with the fgets function) and copy the information you need.
Post some code that you're having trouble with (ie not the whole program, just a snippet or two).Originally posted by PawelK
I wrote a program which stores a lot of informacion in a file, but now I have a problem I want to read out information from the file but not all only some of then
Pleas Help me!!
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
>I wrote a program which stores a lot of informacion in a file, but now I have a problem I want to read out information from the file but not all only some of then
If you know where you have stored what, you can just jump (seek) to the offset in the file and read what you want, else you'll have to run through the whole file looking for what you need.