Simple Pointer Example Program
On this page (5sections)
About this program
This is an example program in c pointer example programs. Read the concept first: C Pointers, then study the code and output below.
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));
}
Related Pages
Learn the concept first, then study the code:
- C Programs — Browse all C Programs.
- C Pointers — Concept — pointers, addresses and dereferencing.
- Simple Program for Print address of Variable Using Pointer in C — More in c pointer example programs.
- Pointer Simple Example Program with Reference operator (&) and Dereference operator (*) — More in c pointer example programs.