a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment
rob05c  ·  3734 days ago  ·  link  ·    ·  parent  ·  post: Why do array indices start at zero?

    int b[5];int* a = b+1;

Incidentally, this is one of the reasons Fortran can potentially be faster than C.

C guarantees correctness for pointer aliasing, which limits the optimisations the compiler can do. Fortran makes no such guarantees.

The C99 restrict keyword obviates this.

I was shocked the first time I saw a simple matrix Fortran program outperform an identical C program.