Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(void){
- int a=1;
- double b=2.0;
- char c='A';
- int* ptr1;
- double* ptr2;
- char* ptr3;
- ptr1=&a;
- ptr2=&b;
- ptr3=&c;
- printf("sizeof(a)%d\n",sizeof(a));
- printf("sizeof(b)%d\n",sizeof(b));
- printf("sizeof(c)%d\n",sizeof(c));
- printf("\n====================================\n");
- printf("address of a %p\n",&a);
- printf("address of b %p\n",&b);
- printf("address of c %p\n",&c);
- printf("\n====================================\n");
- printf("the value of ptr1 %p\n",ptr1);
- printf("the value of ptr2 %p\n",ptr2);
- printf("the value of ptr3 %p\n",ptr3);
- printf("\n====================================\n");
- printf("the value of a %d\n",*ptr1);
- printf("the value of b %.2f\n",*ptr2);
- printf("the value of c %c\n",*ptr3);
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement