[圖解C] Example 702

// Example 702: access address of elements in an array

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int num[5] = {11, 22, 33, 44, 55};
    int i;
 
    // using %p and & to access the address of element
    for (i=0 ; i<5 ; i++){
       printf("num[%d] = %d \t in %p\n", i, num[i], &num[i]);
    }
 
    system("pause");
    return 0;
}