Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   double pointer (http://www.go4expert.com/forums/double-pointer-t3255/)

anilk501 5Mar2007 17:05

double pointer
 
what is use of double paointers and give me some example in real wolrd application

DaWei 5Mar2007 17:20

Re: double pointer
 
I presume you mean a pointer to a pointer, and not a pointer to a double type. Here's a non-programming example: You ask me for contact information for a plumber. I point you to the phone book. The phone book points you to the plumber. A programming example would be a 2D pseudo-array gotten from the heap one row at a time. To access a given element, one would provide a pointer to the row pointer, which would then be dereferenced to get the element.

wrecker 4Apr2007 02:17

Re: double pointer
 
Quote:

Originally Posted by DaWei
I presume you mean a pointer to a pointer, and not a pointer to a double type. Here's a non-programming example: You ask me for contact information for a plumber. I point you to the phone book. The phone book points you to the plumber. A programming example would be a 2D pseudo-array gotten from the heap one row at a time. To access a given element, one would provide a pointer to the row pointer, which would then be dereferenced to get the element.

was a very nice and self explanatory example DaWei. Thanks


All times are GMT +5.5. The time now is 16:01.