Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Andrey Tarasevich <andreytarasevich@xxxxxxxxxxx>
- Date: Thu, 10 Apr 2008 12:57:46 -0700
Tim Wescott wrote:
Yes it is a pointer to an array of 10 chars. No it is not a pointer to char. There _is_ a difference, but the compiler is well aware of it and will seamlessly cast from pointer-to-array-of-N-char to pointer-to-char.
Absolutely not. A C compiler in a relaxed diagnostics mode might allow something like this, since C compilers by default are traditionally very forgiving when it comes to pointer casts. However, such a conversion is illegal from the language point of view. Any half-decent C compiler will normally issue at least a warning about broken assignment.
--
Best regards,
Andrey Tarasevich
.
- Follow-Ups:
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Tim Wescott
- Re: Keil c51 interprets &Array as Array. Is that normal?
- References:
- Keil c51 interprets &Array as Array. Is that normal?
- From: Bill Davy
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Tim Wescott
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Hans-Bernhard Bröker
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Tim Wescott
- Keil c51 interprets &Array as Array. Is that normal?
- Prev by Date: Re: Keil c51 interprets &Array as Array. Is that normal?
- Next by Date: Re: Keil c51 interprets &Array as Array. Is that normal?
- Previous by thread: Re: Keil c51 interprets &Array as Array. Is that normal?
- Next by thread: Re: Keil c51 interprets &Array as Array. Is that normal?
- Index(es):
Relevant Pages
|