0
    // test 1
    int aaa[5] = {1,2,3,4,5};

    int *temp_aaa = aaa;


    for(int i=0; i<5; i++)
        printf("%d\n", temp_aaa[i]);


    exit(0);


    // test 2
    int bbb[5][2] = {{1,2},{3,4},{5,6},{7,8},{9,10}};

    int *temp_bbb = bbb; // error

For test 1, *temp_aaa can reference array aaa[5]

How to reference a array that contains arrays in test 2 to print out each element?

Patrick
  • 293
  • 1
  • 5
  • 14

0 Answers0