I didnt know that!  thanks!
  ----- Original Message -----
  From: Ben Doom
  To: CF-Community
  Sent: Friday, June 25, 2004 9:11 AM
  Subject: Re: C++ anyone?

  You should track this when you create the array.

  Again, the array size is *not* dynamic.  If you create a size 15 array
  of ints, it will always, always, always contain 15 ints.  Just becasue 4
  of them aren't used values doesn't mean they don't exist.  Basically, an
  array is just a contiguous chunk of memory space big enough to hold your
  data plus some metadata (specifically the datatype) to help it with
  pointer math.  You could do the same thing with malloc() and a couple of
  variables.

  In CF, arrays act a whole lot like linked lists, which confused the crap
  out of me at first.  If you need this kind of functionality, you can
  either write your own LL or use the generic template in the STL.

  If I'm going over your head, let me know and I'll explain anything you
  don't get.  If you want to know more, just ask.

  If you want to take this offline, that's fine, too.

  --BenD

  brobborb wrote:

  > thats what I ended up doing.  Now i just need to find out the size of an
  > array.  haha  sizeof(ARRAY) doesn't work :-(
  >
  >   ----- Original Message -----
  >   From: Ben Doom
  >   To: CF-Community
  >   Sent: Friday, June 25, 2004 8:53 AM
  >   Subject: Re: C++ anyone?
  >
  >   Arrays in C aren't like arrays in CF.  They are not dynamic in size.
  >
  >   If you want to remove element 3 from a 5 element list and act like it
  >   never existed, you have to:
  >   copy element 4 to element 3
  >   copy element 5 to element 4
  >   keep track of how many elements are currently in the list.
  >
  >   Does that help at all?
  >
  >   brobborb wrote:
  >
  >   > THIS IS DRIVING ME NUTS!!!!!!11
  >   >
  >   > HOW DO YOU DELETE AN ELEMENT FROM AN ARRAY?!  THIS IS
  > CRAZY>?!  AHHH!!!!!
  >   >
  >
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to