Pointers

boschow's Avatar, Join Date: Feb 2007
Go4Expert Member
Hi,
i just wanted to know, what are pointers used for?
when do we use pointer to a symbol?
when do we use pointer to a function?
when do we use pointer to a pointer . .. ?

Thanks for your time and help,
Best regards
BoSCHoW
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by boschow
i just wanted to know, what are pointers used for?
Mainly pointers are used for passing the address of the variables so the update in a function remains when the function is out of scope.
Quote:
Originally Posted by boschow
when do we use pointer to a symbol?
I assume you meant here variable and when we need the address of the variable.
Quote:
Originally Posted by boschow
when do we use pointer to a function?
I normally avoid using this but when we don't know which exact function to be called but know the type of the function. Is used for event handling where we don't know what is the event handler that will be assigned to the pointer but if its assigned it will have some standard signature.
Quote:
Originally Posted by boschow
when do we use pointer to a pointer . .. ?
As and when needed and in interviews.