Declaration of outer block and inner block : Multi Dimensional Array Pointer « Array « C Tutorial






#include <stdio.h>

int main(void)
{
  int count1 = 1;                         

  do
  {
    int count2 = 0;                       
    ++count2;
    printf("\ncount1 = %d     count2 = %d", count1,count2);
  }while( ++count1 <= 8 );

  /* count2 no longer exists */

  printf("\ncount1 = %d\n", count1);
  return 0;
}
count1 = 1     count2 = 1
     count1 = 2     count2 = 1
     count1 = 3     count2 = 1
     count1 = 4     count2 = 1
     count1 = 5     count2 = 1
     count1 = 6     count2 = 1
     count1 = 7     count2 = 1
     count1 = 8     count2 = 1
     count1 = 9








7.11.Multi Dimensional Array Pointer
7.11.1.Two-Dimensional arrays and pointers
7.11.2.Two-Dimensional arrays: pointer of pointer for its element
7.11.3.Get the values in a two-dimensional array through array pointer
7.11.4.Get values from multidimensional arrays with pointers
7.11.5.Declaration of outer block and inner block