# pointers



## arpanmukherjee1 (Sep 26, 2008)

hi there 

can sb tell me how to use near and far pointers in c/c++


----------



## chandru.in (Sep 26, 2008)

Standard C really has no such thing.  It is an addition done in compilers targeting 8086 CPUs.  There really is little need to use it today unless you are using dinosaur C compilers like Turbo C/C++.

Near pointers - Pointers to memory within same segment and thus has only offset.
Far pointers - Pointers to memory within another segment and thus contains both segment selector and offset.


----------



## Chetan1991 (Oct 6, 2008)

Hey chandru do you mean pointers are obslete nowadays??
I have the book "Let us C" 5th ed. and the author seems to emphasise a lot on pointers as if they are very important.  So wh did he stressed so much if they are obselete???


----------



## QwertyManiac (Oct 6, 2008)

He meant the _near and far pointer_ concepts are obsolete now. Pointers are essential, and will never be removed from C/C++.


----------



## chandru.in (Oct 6, 2008)

Exactly.  I meant only about the idea of near and far pointers.  Pointers themselves will no become obsolete any time soon.


----------



## Chetan1991 (Oct 11, 2008)

what are near and far pointers??


----------



## chandru.in (Oct 11, 2008)

^^  See my first reply.


----------



## gopi_vbboy (Oct 11, 2008)

u don't generally use near and far pointers in c++.


----------



## dheeraj_kumar (Oct 11, 2008)

Near uses 2 bytes, and Far uses 5 bytes, AFAIK.


----------



## red_devil (Oct 11, 2008)

^^ i'm not very sure of that !!

btw what kind of programs make use of the near n far ptrs ?? i've never made any use of those stuff


----------



## lucifer_is_back (Oct 17, 2008)

n6300 said:


> ^^ i'm not very sure of that !!
> 
> btw what kind of programs make use of the near n far ptrs ?? i've never made any use of those stuff


now a days we dont use these types of pointers much 
they were used earlier 
if you want to read more about them 
*en.wikipedia.org/wiki/Far_pointer
*en.wikipedia.org/wiki/C_memory_model


----------

