数据结构(c语言版)1000个问题与解答-数组

1. 利用指针遍历二维数组:

  int ary[3][3] = {{11, 12, 13},
                   {21, 22, 23},
                   {31, 32, 33}};
  for (int i=0; i<3; ++i) {
    for (int j=0; j<3; ++j) {
      std::cout << std::setw(3) << *(*(ary + i) + j);
    }
    std::cout << std::endl;
  }

    原文作者:约瑟夫环问题
    原文地址: https://blog.csdn.net/elloop/article/details/7341306
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞