Simple Pointer Example Program

Initialization Of Pointer Vaibale:

Poniter Syntax: 

pointer_vaibale = &variable;

Example Pointer Program:

#include<stdio.h> 
#include<conio.h> 

void main() 
{ 
	// Declare Pointer Variable
	int i=10; 
	int *Ptr; 
	
	// Assign Pointer Variable
	Ptr=&i; 
	
	// Display Pointer Variable
	printf("\nValue Of i :%d",i); 
	printf("\nAddress Of i :%d",&i); 
	printf("\nValue Of Ptr :%d",Ptr); 
	printf("\nAddress Of Ptr :%d",&Ptr); 
	printf("\nPtr's Pointer Value:%d",*Ptr); 
	printf("\nPtr Equal to &i :%d",*(&i)); 
} 

 

Top Pages