Pointers in C

A pointer is derived data type in c.it is built from one of the fundamental data type available in c programming.pointers can be used to access and manipulate data stored in the memory.

Pointer Variables


data_type *pointer_name;						
							

The * tells that the variable pointer_name is a pointer variable.

pointer_name needs a memory location.

pointer_name points to a variable of data_type.


int *age;							
							

Initialization of Pointer Variables


int age;
int a; /* Declaration */

a = &age;	/* Initialization */						
							

Example of Pointer


#include 
void main()
{
	int *ptr,no;
	no = 10;
	
	ptr = &no;
	
	printf(ā€œ%dā€,*ptr);
	return 0;
}							
							

Output


10							
							
Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!