Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // C lang //
- #include <stdio.h>
- #include <stdlib.h>
- int n;
- ////////////////////////////////////////////////////
- int main() //
- {
- int n2;
- int *p = (int*)malloc(4);
- printf(" p = %d\n", p);
- printf("&p = %d\n", &p);
- *p = 16;
- printf("*p = %d\n", *p);
- }
- // C++ lang //
- #include <stdio.h>
- #include <stdlib.h>
- __int64 n;
- ////////////////////////////////////////////////////
- int main() //
- {
- int n2;
- int *p = (int*)malloc(sizeof(int));
- printf(" p = %d\n", p);
- printf("&p = %d\n", &p);
- *p = 16;
- int &a = *p;
- printf("*p = %d\n", *p);
- printf("*p = %d\n", a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement