Re: [OT] basic detail

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

 



On 2019-02-19 15:44 +0100, Patrick Bégou wrote:
> Hi,
> 
> I need a small theoritical explanation about arrays in C.

These questions are off-topic in gcc-help.  It should go to comp.lang.c or
somewhere.

> I would like to know why using:
> 
> char A[24];
> 
> scanf("%s", A);  and scanf("%s", &A); does the same thing (as it is not
> the same code).
> 
> I've checked that printing A or &A with "%p" prints the same address....
> but why ?

STFG.  The first URL Google suggested for "address of array" is exactly the
answer of this question:

https://stackoverflow.com/questions/2528318/how-come-an-arrays-address-is-equal-to-its-value-in-c
-- 
Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University




[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