Re: Keil c51 interprets &Array as Array. Is that normal?



Tim Wescott wrote:
On Thu, 10 Apr 2008 21:06:16 +0200, Hans-Bernhard Bröker wrote:
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.

Erm, no. Not really.

Pointers to incompatible types are themselves incompatible with each
other, so there's no implicit conversion (what you call "seamlessly
casting").

You're disagreeing with yourself, sir.

I'm reasonably sure I'm not. But feel free to expand on your brief judgement.
.



Relevant Pages

  • Re: Keil c51 interprets &Array as Array. Is that normal?
    ... pointer-to-char. ... Pointers to incompatible types are themselves incompatible with each ... Need to learn how to apply control theory in your embedded system? ... "Applied Control Theory for Embedded Systems" by Tim Wescott ...
    (comp.arch.embedded)
  • Re: Keil c51 interprets &Array as Array. Is that normal?
    ... char. ... but the compiler is well aware of it and ... Pointers to incompatible types are themselves incompatible with each other, so there's no implicit conversion. ...
    (comp.arch.embedded)
  • Re: Keil c51 interprets &Array as Array. Is that normal?
    ... but the compiler is well aware of it ... pointer-to-char. ... char a; ... When you use it on the right-hand side of an assignment, its type immediately decays to 'char*'. ...
    (comp.arch.embedded)
  • Re: Assigning values to char arrays
    ... assigns a value to this pointer-to-char, the value in question being the ... The cpalloc function written above does not allocate storage ... only for a collection of pointers to char. ... is sufficient for pointing at a string, ...
    (comp.lang.c)
  • Re: How to initialize and array in a structure?
    ... you can't have a zero size array. ... >when I try something like test.add=3 or test.addit.a=3, the compiler ... >gives me the warning>'incompatible types in assignment'. ... would work, but set ato the numeric value 3, not the character ...
    (comp.lang.c)