Re: File seek

From: Mauricio Lange (mlange_at_cett.nospam.conae.gov.ar)
Date: 08/10/04


Date: Tue, 10 Aug 2004 16:55:24 -0300

Hi,
To move to the 6th byte you dont need to find the data types in the file. A
byte is a byte. Maybe he refered to that.

Mauricio

"Arvind Varma Kalidindi" <axvarma@lycos.com> wrote in message
news:2614aa51.0408101146.5f3ff30b@posting.google.com...
> Hi,
> I was asked this question in an interview recently. "How do you
> move to the 6th byte in a file?" ... My thinking would be to find the
> data types in the file, set a base pointer and advance it by 6. I
> mean, ptr+6. Another way to ask the same question is how do you move
> to the 3rd record in a file (considering that the file is made up of
> records).
> I told the interviewer that we could do a seek to move to the
> specific byte. At that time, the interviewer nodded his head to show
> his approval of my answer, but I came to know that he thought there is
> a more effective way of doing this. Can anyone throw some pointers on
> what that effective way could be?
>
> Regards,
> Arvind.



Relevant Pages

  • Re: File seek
    ... To move to the 6th byte you dont need to find the data types in the file. ... > data types in the file, set a base pointer and advance it by 6. ... the interviewer nodded his head to show ...
    (comp.lang.c)
  • Re: File seek
    ... > data types in the file, set a base pointer and advance it by 6. ... you can't set C or C++ pointers to point /into/ files. ... the interviewer nodded his head to show ... 'fseek' counts from zero. ...
    (comp.lang.c)
  • Re: File seek
    ... > data types in the file, set a base pointer and advance it by 6. ... you can't set C or C++ pointers to point /into/ files. ... the interviewer nodded his head to show ... 'fseek' counts from zero. ...
    (comp.lang.cpp)
  • File seek
    ... set a base pointer and advance it by 6. ... I told the interviewer that we could do a seek to move to the ... the interviewer nodded his head to show ... Regards, ...
    (comp.lang.cpp)
  • File seek
    ... set a base pointer and advance it by 6. ... I told the interviewer that we could do a seek to move to the ... the interviewer nodded his head to show ... Regards, ...
    (comp.lang.c)