couple of c++ questions

Discussion in 'OT Technology' started by mrburner, Sep 21, 2003.

  1. mrburner

    mrburner Ron Paul 2008

    Joined:
    May 9, 2001
    Messages:
    7,448
    Likes Received:
    0
    Location:
    Phoenix
    why would hard coding the maximum size of a point array cause any problems? and how can i overcome these problems?
     
  2. aphoric

    aphoric Even if god did exist, it would be necessary to ab

    Joined:
    Aug 29, 2003
    Messages:
    918
    Likes Received:
    0
    Location:
    Leaving Afghanistan
    use STL
     
  3. mrburner

    mrburner Ron Paul 2008

    Joined:
    May 9, 2001
    Messages:
    7,448
    Likes Received:
    0
    Location:
    Phoenix
  4. Scoob_13

    Scoob_13 Anything is possible, but the odds are astronomica

    Joined:
    Oct 5, 2001
    Messages:
    73,798
    Likes Received:
    38
    Location:
    Fort Worth. Hooray cowgirls.
    Dynamically create your array.

    As for why is would cause problems, if you end up attempting to write more members to the array than you have slots for, you'll run into memory issues and it'll crash.

    It's kind of like trying to put too many groceries in a bag, pretty soon the bag rips and you're toast.
     
  5. aphoric

    aphoric Even if god did exist, it would be necessary to ab

    Joined:
    Aug 29, 2003
    Messages:
    918
    Likes Received:
    0
    Location:
    Leaving Afghanistan
    Use Templates, man. Look up STL on google or something, it's no Java libraries, but it is the best you can hope for with C++.
     

Share This Page