Pointer/array compatibility

Julian Cowley cs211s14 at uhccux.uhcc.hawaii.edu
Fri Sep 29 12:38:41 AEST 1989


In article <1989Sep28.205805.9786 at jarvis.csri.toronto.edu> flaps at dgp.toronto.edu (Alan J Rosenthal) writes:
>I wrote this:
>>int a[2][3][5], ***ippp, **ipp, *ip, i, j;
>>
>>ip = a[0][0];		/* why? */
>>ipp = a[0];		/* why? */
>>ippp = a;		/* why? */
>
>Well, the answer is that ipp = a[0] and ippp = a are not legal!  What compiler
>are you using?  (rhetorical question)

The Ultrix 3.1 cc compiler, which I thought was derived from
PCC (i.e., reliable).  Even lint does not complain about the
expressions.

Well, at least that's cleared up.  So much for getting concrete
answers to simple questions by running a test program through a
compiler.

Julian Cowley
cs211s14 at uhccux.uhcc.hawaii.edu
cs211s14 at uhccux.bitnet



More information about the Comp.lang.c mailing list