When we open a new file using the FILE structure and fopen(), the file pointer points to the first byte of the file. How can we know the location of any byte in the file using the file pointer? When I try to store the location of fp (file pointer) at a desirable location it gives me an absolute offset and not the offset which is from the starting of the file i.e 00. How do I know the location of any byte in a file from the file's first byte?
Jump to Post
When I try to store the location of fp (file pointer) at a desirable location
How exactly are you doing this? While FILE is supposed to be an opaque type, it's generally implemented as a structure. If you're storing the pointer to a FILE then that's meaningless. If …
All 2 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.