C Programming Tutorial
Computer Tutorial

Pointer Variable



Pointer Variable

If a variable is going to be a pointer, it must be declared as such. A pointer declaration consists of a base type, an *, and the variable name.
The general form for declaring a pointer variable is :
Variable type *pointer name;
Eg-
int *j ;
where type is the base type of the pointer and may be any valid type. The name of the pointer variable is specified by name.
The base type of the pointer defines the type of object to which the pointer will point. All pointer operations are done relative to the pointer's base type. For example, when you declare a pointer to be of type int *, the compiler assumes that any address that it holds points to an integer.

A Simple Program Using Pointer to initialize and print the value and address of variable.