fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int arr[3][3] = {{1,2,3}, {4,5,6}, {7,8,9}};
  8.  
  9. for(size_t i=0; i<3; i++)
  10. {
  11. for(size_t j=0; j<3; j++)
  12. {
  13. cout<<arr[i][j]<<",";
  14. }
  15. cout<<endl;
  16. }
  17.  
  18. cout<<endl;
  19.  
  20. int (*p)[3] = arr;
  21.  
  22. for(size_t i=0; i<3; i++)
  23. {
  24. for(size_t j=0; j<3; j++)
  25. {
  26. cout<<*(*(p+i)+j)<<",";
  27. }
  28. cout<<endl;
  29. }
  30.  
  31. return 0;
  32. }
  33.  
  34.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1,2,3,
4,5,6,
7,8,9,

1,2,3,
4,5,6,
7,8,9,