Sunday, 11 May 2014

Pointer in c

Pointer in c

#include<stdio.h>                       //header file stdio.h
#include<conio.h>                 //header file conio.h
main()
{
int *p,a=10;        //pointer variable and normal variable declaration
clrscr();
p=&a;                           //assign address of a to p
printf("the address of a is %u",p);
printf("the value of a is %d",*p);
getch();
}                          //end of the program

No comments:

Post a Comment