Pointers

Address de-reference operator(&)

When we declare a varible, it must be stored in a concrete location in a succession of cells(the computer memory). We generally do not decide where the variable is to be placed. Fortunately, that is done automatically by the compiler and the operating system on runtime. But once the operating system has assigned an address to a variable we may sometimes be interested in knowing where it has been stored.
This can be done by preceding the variable identifier by the ampersand sign(&). which literally means                                 "address of " For example: - ptr = $a;
would assign the address of variable a to variable ptr. The ampersand refers to the address of a variable in memory and not its contents. LEARN MORE>>

No comments: