Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: Are 2D arrays contiguous?

Reply
Thread Tools

Re: Are 2D arrays contiguous?

 
 
daniel
Guest
Posts: n/a
 
      08-15-2008
On Aug 15, 1:38*pm, Tristan Miller <(E-Mail Removed)>
wrote:
> Greetings.
>
> Are statically allocated two-dimensional arrays guaranteed to be
> contiguous, or is it possible the compiler will allocate padding after
> each row? *Is the following code OK?
>
> #include <string.h>
>
> int main(void) {
> * char a[5][5];
> * memset(a, 'x', 25);
> * return 0;
>
> }
>
> Regards,
> Tristan
>
> --
> * *_
> * _V.-o *Tristan Miller [en,(fr,de,ia)] *>< *Space is limited
> */ |`-' *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= *<> *In a haiku, so it's hard
> (7_\\ * *http://www.nothingisreal.com/* >< *To finish what you



As far as I know they are.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multidimensional arrays and arrays of arrays Philipp Java 21 01-20-2009 08:33 AM
char arrays and integer arrays... why the difference? Bill Reyn C++ 3 06-22-2004 12:01 PM
Arrays.asList() returning java.util.Arrays$ArrayList Alexandra Stehman Java 5 06-17-2004 06:04 PM
Arrays and Pointers to Arrays kelvSYC C Programming 2 09-26-2003 06:52 AM
initializing arrays of arrays Mantorok Redgormor C Programming 4 09-11-2003 02:08 AM



Advertisments