Indexing vs pointers

Markku Savela msa at clinet.FI
Mon May 9 06:01:11 AEST 1988


In article <834 at srs.UUCP> srs!craig at cs.rochester.edu (Craig Schmackpfeffer) writes:
>
>The problem occurs when you are trying to index anything bigger than a 
>single character. [...]

  Yes, I quite right! I merely wanted to point out, that one shouldn't
make statemens like " *s++ = *p++  is ALWAYS better than s[i] = p[i]; ++i"
and gave ONE counter example (Intel machine + large memory model).

  I think it's very good practice occasionally check the assembler code
your high level language compiler procudes. I do generally this kind
of thing after a program works. And sometimes I change my coding as a
result (if I feel the relevant spot of code is critical).

Markku Savela,   msa at clinet.fi



More information about the Comp.lang.c mailing list