Thread: Dynamic Arrays?

  1. #1
    Registered User
    Join Date
    Apr 2004
    Location
    Ohio
    Posts
    147

    Unhappy Dynamic Arrays?

    *sigh* I hate being a newbie.

    How would one create dynamic arrays?

    The particular use is this:

    Loading a map file. Read in the width and height of a 2D matrix. Reallocate the map array to the new size.

    Or, would it just be easier to create a maximum size (let's say 2000 for now) and just read the X, Y coords defined in the map file?

    Leeor...

  2. #2
    Obsessed with C chrismiceli's Avatar
    Join Date
    Jan 2003
    Posts
    501
    Look into pointers , malloc, realloc , etc.
    Help populate a c/c++ help irc channel
    server: irc://irc.efnet.net
    channel: #c

  3. #3
    Registered User
    Join Date
    Apr 2004
    Location
    Ohio
    Posts
    147
    Cool. Thanks!

    Leeor...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating and freeing dynamic arrays
    By circuitbreaker in forum C++ Programming
    Replies: 8
    Last Post: 02-18-2008, 11:18 AM
  2. Replies: 16
    Last Post: 01-01-2008, 04:07 PM
  3. processing dynamic arrays
    By Mario F. in forum C++ Programming
    Replies: 9
    Last Post: 06-04-2006, 11:32 AM
  4. Dynamic (Numeric) Arrays
    By DavidB in forum C++ Programming
    Replies: 5
    Last Post: 05-03-2006, 07:34 PM