On 2017-09-05, Marko Rauhamaa <ma...@pacujo.net> wrote:

> Pointer arithmetics is not an essential part of C. One could argue that
> it was a mistake to include it in the language.

One may argue that it was a mistake, but I remember at least one
implementation where pointer arithmetic was hugely more efficient than
indexing into arrays.  Incrementing a pointer through an array was
way, way faster than indexing through the array by incrementing an
array subscript.

But, that was 25 years ago on an 8-bit CPU where where integer
multiplies were expensive.  The last time I compare the two methods
with a recent GCC on a 32-bit CPU, it generated pretty much the same
code either way...

-- 
Grant Edwards               grant.b.edwards        Yow! Someone in DAYTON,
                                  at               Ohio is selling USED
                              gmail.com            CARPETS to a SERBO-CROATIAN

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to