POINTERS IN C.
#include<stdio.h>
int main()
{
printf("Let's learn about pointers\n");
int a=76;
int* ptra = &a;
int* ptra2 = NULL;
printf("The address of pointer to a is %p\n", &ptra);
printf("The address of a is %p\n", &a);
printf("The address of a is %p\n", ptra);
printf("The address of some garbage is is %p\n", ptra2);
printf("The value of a is %d\n", *ptra);
printf("The value of a is %d\n", a);
return 0;
}
OUTPUT:
Let's learn about pointers
The address of pointer to a is 0061FF14
The address of a is 0061FF18
The address of a is 0061FF18
The address of some garbage is is 00000000
The value of a is 76
The value of a is 76
Tysm
ReplyDeleteOsm
ReplyDelete