Retrieve the Base Addresses of Rows in a Two-Dimensional Array - C Array

C examples for Array:Multidimensional Arrays

Description

Retrieve the Base Addresses of Rows in a Two-Dimensional Array

Demo Code

#include <stdio.h>

int main()//from   w ww  . j  av a  2 s.c o  m
{
     int num[3][2] = {
                       {1, 4},
                       {2, 5},
                       {3, 6}
                     };
    
     for(int r = 0; r < 3; r++){
        printf("Base address of row %d is: %u \n", r+1, num[r]);
     }
    
     return(0);
}

Related Tutorials