fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. const short si2DArray[2][3] = { { 11, 12, 13 }, { 21, 22, 23 } };
  6. const auto psi2DPointer = reinterpret_cast<const char*>(si2DArray);
  7.  
  8. for(auto i = 0U; i < sizeof(si2DArray) / sizeof(*si2DArray); ++i) {
  9. for(auto j = 0U; j < sizeof(*si2DArray) / sizeof(**si2DArray); ++j) {
  10. cout << *reinterpret_cast<const short*>(psi2DPointer + i * sizeof(*si2DArray) + j * sizeof(**si2DArray)) << '\t';
  11. }
  12. cout << endl;
  13. }
  14. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
11	12	13	
21	22	23