Code example:
#include <stdio.h> int main() { int a[] = {1,2,3,4,5}; int (*p)[5] = &a; //Note //int (*p)[5] = a; // builds (with warnings) and in this case appears to give the same result printf( "a = 0x%x\n" , (int *)a); printf( "&a = 0x%x\n", (int *)(&a)); printf( "p = 0x%x", (int *)p); return; }
The output is the same for both methods.
$ ./a.exe a = 0x22cd10 &a = 0x22cd10 p = 0x22cd10
Compiler
$ gcc --version gcc (GCC) 3.4.4 (cygming special, gdc 0.12 using dmd 0.125) Copyright (C) 2004 Free Software Foundation, Inc. It is a free software; see source for copy conditions. There is no guarantee; not even for COMMERCIAL VALUE or SUITABILITY FOR A PARTICULAR PURPOSE.
source share