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?
anumash
0
Newbie Poster
Recommended Answers
Jump to PostWhen 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
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.