What exactly is an 'offset' to something?

This is a discussion on What exactly is an 'offset' to something? within the C++ Programming forums, part of the General Programming Boards category; What exactly is an 'offset' to something?...

  1. #1
    Shadow12345
    Guest

    What exactly is an 'offset' to something?

    What exactly is an 'offset' to something?

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    362
    Crummy explanation? The 'offset' is the number of char's succeeding the pointer position.

    An example would be reading a file starting at '20':

    ifile.read(20, record.fname);

    The offset is 20 char's into the file from where the pointer is currently set.

    I believe that 'offset' is used more generically than that, but you can grasp the idea from my example.

    -Skipper
    "When the only tool you own is a hammer, every problem begins to resemble a nail." Abraham Maslow

  3. #3
    Shadow12345
    Guest
    mmmmmmmmm....barely. I guess I am looking for the generic term then. Does it matter on context/usage?

  4. #4
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    If you have a binary file offset 0 is the first byte, offset 1 is
    the second byte etc.

  5. #5
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    It can also be used when talking about a memory addresses.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unsigned Long returning signed value
    By dinklebaga in forum C Programming
    Replies: 3
    Last Post: 03-06-2009, 06:07 AM
  2. My memory management solution
    By cboard_member in forum Game Programming
    Replies: 20
    Last Post: 08-23-2006, 10:07 AM
  3. offset
    By Rhidian in forum C Programming
    Replies: 6
    Last Post: 04-14-2005, 09:57 AM
  4. Relocation in .obj -files
    By willkoh in forum C++ Programming
    Replies: 6
    Last Post: 04-06-2005, 02:59 PM
  5. I still do not understand offset, please give me examples
    By Shadow12345 in forum C++ Programming
    Replies: 2
    Last Post: 11-13-2002, 09:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21