Advertisement
Lisaveta777

Array, &, *

Oct 3rd, 2018
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.78 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int number;
  6.     int arr2[2][2][2] = {1,2,3,4,5,6,7,8};
  7.  
  8.     printf("&arr2[0][0][0] is %p\n",&arr2[0][0][0]);  //0028FF00
  9.     printf("arr2[0][0] is     %p\n",arr2[0][0]);     //0028FF00
  10.     printf("&arr2[0][0] is    %p\n",&arr2[0][0]);    //0028FF00
  11.  
  12.  
  13.     /*int zippo[4][2] = {  {1,2},  {11,12},  {21,22},  {31,32}   };
  14.     //int arr[4][2] = {{1,2},{3,4},{5,6},{7,8}};
  15.     printf("arr[0] -%d,&arr[0]-%p\n",arr[0],&arr[0]);
  16.  
  17.  
  18.     printf("zippo[%d] is %d, it's address is %p\n",0,zippo[0],&zippo[0]);
  19.     printf("zippo[%d][%d] is %d, it's address is %p\n",0,0,zippo[0][0],&zippo[0][0]);
  20.     printf("zippo[%d] is %p\n",0,zippo[0]);
  21.     printf("zippo[%d][%d] is %d, it's address is %p\n",0,1,zippo[0][1],&zippo[0][1]);*/
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement