Pointer is a variable that stores the address of another variable. It dynamically allocates the memory.
Just copy the bellow code and paste it to your TurboC software. And then run the program. You can download the TurboC software.
Source Code...
#include <stdio.h>
#include <conio.h>
void main()
{
int *ptr, p;
clrscr();
p = 77;
ptr = &p; /* to assign the address of p is to ptr (pointer) */
printf("%d", *ptr); /* to show the value of p using ptr variable */
getch();
}
Output...
77
0 comments:
Post a Comment