Read OnLine C- Program Example
07_POINTER (01_POINTER) | |
---|---|
PRAC 3 | PRAC 4 |
//wap to print Address of the varable #include<stdio.h> #include<conio.h> void main() { int i=3; int *j; j=&i; clrscr(); printf("\n Address of i=%u",&i); printf("\n Address of i=%u",j); printf("\n Address of j=%u",&j); printf("\n Value of j=%u",j); printf("\n Value of i=%d",i); printf("\n Value of i=%d",*(&i)); printf("\n Value of i=%d",*j); getch(); } -------output-------- Address of i=65524 Address of i=65524 Address of j=65522 Value of j=65524 Value of i=3 Value of i=3 Value of i=3 |
//wap to print Address of the varable #include<stdio.h> #include<conio.h> void main() { int i=3,*j,**k; j=&i; k=&j; clrscr(); printf("\n Address of i=%u",&i); printf("\n Address of i=%u",j); printf("\n Address of i=%u",*k); printf("\n Address of j=%u",&j); printf("\n Address of j=%u",k); printf("\n Address of k=%u",&k); printf("\n Value of j=%u",j); printf("\n Value of k=%u",k); printf("\n Value of i=%d",i); printf("\n Value of i=%d",*(&i)); printf("\n Value of i=%d",*j); printf("\n Value of i=%d",*j); printf("\n Value of i=%d",**k); getch(); } -------output-------- Address of i=65524 Address of i=65524 Address of i=65524 Address of j=65522 Address of j=65522 Address of k=65520 Value of j=6524 Value of k=6522 Value of i=3 Value of i=3 Value of i=3 Value of i=3 Value of i=3 |
Previous | Next |
Download | Download |