C PROGRAMMING
MULTIPLE CHOICE QUESTION
OLD QUESTION BANK
SAMPLE QUESTION 2080 AND SOLUTION

Pointer declaration in C


The syntax to declare a pointer variable in C:

<type> *<pointer_variable_name>;

Here:

<type> is the type of data that the pointer will point to.

* indicates that this is a pointer variable.

<pointer_variable_name> is the name of the pointer variable.

The data type associated with the pointer variable indicates that the given pointer variable will hold the address of that particular data type. For example:

int a=10,*iptr;
float b=2.4,*fptr;
char c='@',*cptr;

iptr = &a;
fptr = &b;
cptr = &c;


The integer pointer iptr will store address for integer variable, the float pointer fptr indicates that it will store the address of floating point variable and so on.