Print value of a variable using Pointer

#include<stdio.h>
#include<conio.h>
int main()
{
int i=3;
//pointer declaration
int *ptr;              
clrscr();
//assigning address of variable to pointer
ptr=&i;
printf("the value of i is %d",*ptr);
getch();
return 0;
}

0 comments:

Post a Comment