(Untitled)

Aug 28, 2006 01:55

So I've yet to really see a need for arrays in programming, and then this came out of me during a conversation with Alex ( Read more... )

Leave a comment

Comments 2

anonymous August 28 2006, 07:45:59 UTC
XD "nevermind, just bend over"

Reply


tasslehoff_b August 31 2006, 07:06:33 UTC
Heh. There are a lot of ways to use arrays, though. Pretend I've got two matched arrays called scores[] and names[] but they're out of order and I'd like to say something about them.

int scoreSwap;
String nameSwap;

for(int i=0;i scores[i]){
               scoreSwap = scores[j];
               scores[j] = scores[i];
               scores[i] = scoreSwap;
               nameSwap = names[j];
               names[j] = names[i];
               names[i] = nameSwap;
          }
     }
}

for(int i=0;(i

Reply


Leave a comment

Up