View Single Post
  #19   Spotlight this post!  
Unread 18-05-2009, 09:30
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: **FIRST EMAIL**/Java and Orbit Balls

Quote:
Originally Posted by The Lucas View Post
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:
Code:
ptr = 365;
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.