Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8808645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:40:33+00:00 2026-06-14T02:40:33+00:00

offset=ftell(ptr)-sizeof(student1); fseek(ptr,offset,SEEK_SET); fwrite(&student1,sizeof(student1),1,ptr); This C code means move the pointer from the current position

  • 0
offset=ftell(ptr)-sizeof(student1);
fseek(ptr,offset,SEEK_SET);
fwrite(&student1,sizeof(student1),1,ptr);

This C code means move the pointer from the current position ftell(ptr) to start of the just read structure block. Am I right?

If I’m right, can I use SEEK_CUR instead of SEEK_SET to go back to start of the structure block in the file?

Please show me how to use SEEK_CUR and go backward to start of the structure block.

I’m newbie to programming. So please kindly help me.

Edit: Thank you for the answers. What I’m trying to do is to search for a keyword (Roll number of a student) and update this student’s information (Name,Address,..). The updated datas are replaced the previous datas successfully. Please let me ask one more question. It there any way to insert the new data above the previous data instead of replacing it with old data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:40:34+00:00Added an answer on June 14, 2026 at 2:40 am

    This C code means move the pointer from the current position [ ftell(ptr) ] to start of the just read structure block. Am I right?

    I think so.

    Please show me how to use SEEK_CUR and go backward to start of the structure block.

    You can use a negative offset.

    #include <stdio.h>
    
    fseek (ptr, -sizeof student1, SEEK_CUR);
    

    Anyway, you should avoid these calls; it could be very slow. Use rather sequential reading.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code var offset = $('#snapwrap_inner').offset(); alert(offset.left) in FF returns 0px but in Opera
I'm getting illegal offset type error for every iteration of this code. Here's the
I hava a binary file like this : offset | size/type | Description -------+-----------+-----------------------------------------------------------
I am am given the following: The offset of the user's time from GMT
I am trying to get the offset hours from UTC, given a summer date.
What should be the buffer offset value for U & V in YUV444 format
What is the equivlant of this: while (Offset < packet.Data.Length) { Offset += m_Socket.Receive(packet.Data,
I want to get clients Time Zone offset from his IP address for my
In Java how can I offset the knob from my JSilder track? \/ |------------------------------|
Does Unix store the offset of the machine from GMT internally? like for eg:india

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.