Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. void PrintArray( int(*pInt)[3] )
  6. {
  7. // how to iterate here printing pInt content?
  8.  
  9. int nRow = sizeof(*pInt) / sizeof(int);
  10. cout << nRow << endl; // the result: 3 not 2! i get the nColumns instead!!?
  11. }
  12.  
  13. int main()
  14. {
  15. int array[2][3] = { {1,2,3},
  16. {4,5,6}};
  17. int(*pArray)[3] = array;
  18. PrintArray(pArray);
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement