Re: Warning when using const pointer to fixed size array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 01.12.2009 00:46, schrieb me22:
2009/11/30 Thomas Martitz<thomas.martitz@xxxxxxxxxxxxxxxxxxxxx>:
What address are you taking? "array" already stands for the address of the
first element (and is hence sort of a pointer). I'm not sure you can take
the address of the array name as I think it doesn't have one.

You can, actually:

     int main() {
         int a[4];
         int (*p)[4] =&a;
     }


I didn't try gcc, but visual studio compiler gives an error on that one.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux