Friday, October 3, 2014

pointers

 What are pointers? When and why they are used? Explain in detail with sample programs. (JAN 2009/MAY 2009)

Pointer variable is needed to store the memory address of any variable. Denoted by (*) asterisk.
Pointer Declaration: Syntax:
datatype *variable-name;
Example:
int *a;
· Pointers and Arrays
· Pointers and Strings
· Pointer as function arguments
· Pointer too pointer

Example program:
· To add two numbers through variables and their pointers.
· To assign a pointer value to another variable.

No comments:

Post a Comment