in c progggg?

what is an offset

Additional Details

1 week ago
yes offset address what does it meanBy rahul r

Other posts have provided the correct definitions and common computer and programming usages. However, in C language, the most common use of an offset would be among the following three, roughly in order.

1) The size of an object stored in a memory buffer is often refferred to as the "offset". It is used to increment the file or buffer pointer into the stream or memory buffer. This way you can read one set of data at a time and then move the pointer to the next, either automatically or programmatically.

2) When using C under DOS, you may occasionally see a far pointer converted to an actual memory address in segment:offset format. Or you may see the reverse happen. Both are fairly rare unless you are programming code to do low level hardware manipulations directly or through the BIOS.

3) You may occasionally see the same usages in sections of code that are actually inline assembler code. This is fairly common when using C to write drivers, low level graphics libraries or hardware testing routines.

These three are the most common in my experience. Perhaps someone else can add some more?

Source(s):
The twisted mind of me.

1 week ago
u mean offset address?
I never heard of an offset in C programming ... but in general computer architecture ... the offset is the address that is added to the generated address to get the physical address of a certain location in memory
well there two type of addressing schemes for accessing computer main memory.........namely physical scheme - which is the actual physical scheme based on the hardware.....and another one is logical addressing - in this physical addresses are broken down in the form of logical address of the form (segment:offset)........this is done because a 32 bit computer can not access to the maximum of 2 ^ 32 so it is evitable to derive some scheme to do that as the main memory size ids growing daya by day.......if you still not clear than i give you a very well know similar procedure in computers........

take a 40 gb disk drive....lets say you partition it into 3 partitions c,d & e of 15,15 and 10 gb respectively...then the segment is the no. or letter of drive and offset is the address is some address in that segment.....
Offset in general means that you express a position by giving the difference of a position (the offset) relative to known position (often referred as 'base').