Thread: mem allocation in c

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    2

    mem allocation in c

    Hi,

    Can nyone tell me how memory is allocated for a multi dimensional array.
    I know that an array occupies contiguous memory. But what about multi dimensional
    array?

    thanks in advance

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Also contiguous memory, with the farthest-to-the-right dimension changing "fastest" (i.e. you have 0,0,0, then 0,0,1, then 0,0,2, etc).

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    2
    @tabstop: Thanks for the help

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 02-23-2010, 06:17 AM
  2. Dynamic mem allocation, how to get it right?
    By Subsonics in forum C Programming
    Replies: 31
    Last Post: 02-08-2009, 01:41 PM
  3. does C automaticlly free mem allocation?
    By msshapira in forum C Programming
    Replies: 2
    Last Post: 01-26-2009, 03:37 AM
  4. Structs and mem allocation
    By reversaflex in forum C Programming
    Replies: 2
    Last Post: 07-03-2008, 07:46 AM
  5. dynamic mem allocation prgm crash
    By rip1968 in forum C++ Programming
    Replies: 11
    Last Post: 05-10-2002, 05:09 PM