#include <iostream>

using namespace std;

void f(int a[][3], int row)
{
  for(int i = 0; i < row; i++)
  {
    for(int j = 0; j < 3; j++)
    {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
}


int main()
{

  int a[4][3] = {{1},{2},{3},{4}};

  cout <<"a is " << a << endl;
  cout <<"a[0] is " << a[0] << endl;
  cout <<"*a is " << *a << endl;
  cout <<"**a is " << **a << endl;
  cout <<"a[0][0] is " << a[0][0] << endl;
  f(a,4);
  return 0;
}

a is 0x7ffc3cf701c0
a[0] is 0x7ffc3cf701c0
*a is 0x7ffc3cf701c0
**a is 1
a[0][0] is 1
1 0 0
2 0 0
3 0 0
4 0 0

 

posted on 2018-09-01 15:12  newbird2017  阅读(88)  评论(0编辑  收藏  举报