Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void PrintArray( int(*pInt)[3] )
- {
- // how to iterate here printing pInt content?
- int nRow = sizeof(*pInt) / sizeof(int);
- cout << nRow << endl; // the result: 3 not 2! i get the nColumns instead!!?
- }
- int main()
- {
- int array[2][3] = { {1,2,3},
- {4,5,6}};
- int(*pArray)[3] = array;
- PrintArray(pArray);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement