Dev Tool Tips/C/C++2010. 4. 1. 10:44
최근 KLDP 사이트에서 누군가 올린 질문을 보고 곰곰 생각해본 문제다.

/* test.c */
  1     #include <stdio.h>
  2
  3     int main(int argc, char** argv)
  4     {
  5         int a[10]={0,1,2,3,4,5,6,7,8,9};
  6         printf("   a: %p\n", a);
  7         printf("  &a: %p\n", &a);
  8         printf(" a+1: %p\n", a+1);
  9         printf("&a+1: %p\n", &a+1);
 10        return 0;
 11     }  

$ cc test.c
$ ./a.out
       a: 0x7fff15795fc0
     &a: 0x7fff15795fc0
   a+1: 0x7fff15795fc4
&a+1: 0x7fff15795fe8

감이 오는가?
Posted by young.h.rhie