Re: embedded questions!!!



On Fri, 13 Jan 2006 19:18:53 GMT in comp.arch.embedded, Jonathan
Kirwan <jkirwan@xxxxxxxxxxxxxx> wrote:

>On Fri, 13 Jan 2006 10:47:45 -0600, Dave Hansen <iddw@xxxxxxxxxxx>
>wrote:
>
>>"a[i]" has *exactly* the same meaning as "(*a + i)" whether a is a
>>pointer or array.
>
>You mean *((a)+(i)). Or perhaps more precisely, to capture usual

Actually, I meant "*(a + i)". Apologies for fat-fingering that. I
think, however, the additional parentheses in *((a)+(i)) are
redundant, at least if a[i] is a well-formed expression.

>unary conversion rules, *((&a[0])+(i)).

Well, no, actually, that's not necessary, and arguably wrong. Consider
i[a], which should be equivalent to a[i].

Regards,
-=Dave

--
Change is inevitable, progress is not.
.



Relevant Pages

  • Re: Please help optimize (and standarize) this code...
    ... Without the parentheses you can only use names of ... >> struct xyz { ... but, when used in value context like here, a pointer to the first ... element of the array. ...
    (comp.lang.c)
  • Re: embedded questions!!!
    ... >>>pointer or array. ... >think, however, the additional parentheses in *+) are ... Prev by Date: ...
    (comp.arch.embedded)
  • =?iso-8859-1?q?Re:_What=B4s_wrong_with_the_following_code_=3F_(problem_with_a_pointer)?=
    ... array j, without making it global? ... int *j; ... You are confusing a pointer and what it points to. ... Note that the parentheses in this statement are superfluous. ...
    (comp.lang.c)
  • Re: char **argv & char *argv[]
    ... "pointer to pointer to char". ... >> pointer)) pointing to the first element of an array. ... so we have to start adding more context. ... type "pointer to char", rather than "array MISSING_SIZE of char". ...
    (comp.lang.c)
  • Re: why cannot assign to function call
    ... hypothetical C-like languages, ... sizeof business would still indicate that a pointer was being passed. ... talk about variables of an array type. ... the earlier version of the standard didn't have numbered ...
    (comp.lang.python)