Thread: Issue with arrays, pointers, and structs.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834
    I'd say he's 50% there. Need to malloc each struct. Or stop using an array of pointers to structs and just use an array of 10 structs. population[10] (without the *)

    [ never mind. slingerland3g has already suggested it... while I was posting. ]
    Last edited by nonoob; 03-29-2010 at 03:08 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Structs and arrays - overview and help neede
    By pistacchio in forum C Programming
    Replies: 7
    Last Post: 01-11-2010, 02:11 AM
  2. Arrays, Structs, Pointers, and unexpected crashes
    By KairosDrasis in forum C Programming
    Replies: 2
    Last Post: 04-13-2009, 12:37 AM
  3. a question on pointers, structs and arrays
    By onefootswill in forum C Programming
    Replies: 3
    Last Post: 12-06-2007, 01:27 AM
  4. Passing pointers to two-dimensional arrays of structs
    By dr.neil.stewart in forum C Programming
    Replies: 2
    Last Post: 09-07-2007, 10:25 AM
  5. passing structs & pointers to structs as arguments
    By Markallen85 in forum C Programming
    Replies: 6
    Last Post: 03-16-2004, 07:14 PM