Quote:
Originally Posted by The Lucas
You can't dereference (&) and do pointer arithmetic like that in Java.
|
Right. The whole discussion here is based on the lack of pointer arithmetic in Java. But I'm still trying to find out why some think that pointer arithmetic is more efficient than using arrays. My understanding is that they compile to exactly the same thing, since in C
a[i] is just syntactical sugar for
*(a+i). I used to confuse people by writing
i[a] instead, which gives exactly the same result.
Quote:
There is no matching array index expression for this:
|
Without significant context, I'm at a loss to understand why you'd want to write it. With the exception of using memory-mapped I/O, I have yet to see any examples
anywhere where using absolute pointers gives any improvement in efficiency over using arrays.