2D arrays: are all elements in a 2d array guarenteed to be contiguous?

Discussion in 'C++' started by Paul, Nov 24, 2004.

  1. Paul

    Paul Guest

    See topic;

    Context:
    Passing arrays around in a MPI system(Message Passing Interface-
    Parallel Program crap)

    Thanks much!
    -Paul
     
    Paul, Nov 24, 2004
    #1
    1. Advertising

  2. Paul

    Jack Klein Guest

    On Tue, 23 Nov 2004 22:21:29 -0800, Paul <> wrote in
    comp.lang.c++:

    > See topic;


    Don't do that. There are some newsreaders still in wide use that do
    not show the subject line while displaying bodies.

    > Context:
    > Passing arrays around in a MPI system(Message Passing Interface-
    > Parallel Program crap)


    The context is immaterial.

    > Thanks much!
    > -Paul


    In any case, the answer is no, there is no such guarantee, because
    there is no such thing as a two (or higher) dimensional array in C++.
    There are arrays of arrays, but the behavior is not defined for
    accessing them as a single contiguous array with a type other than
    unsigned char.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
     
    Jack Klein, Nov 24, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Olumide
    Replies:
    9
    Views:
    2,014
    Dan Pop
    Nov 30, 2004
  2. Replies:
    3
    Views:
    397
    James Kanze
    Dec 21, 2007
  3. daniel

    Re: Are 2D arrays contiguous?

    daniel, Aug 15, 2008, in forum: C Programming
    Replies:
    0
    Views:
    402
    daniel
    Aug 15, 2008
  4. pemo

    c99 multidimensional arrays contiguous?

    pemo, Mar 16, 2010, in forum: C Programming
    Replies:
    39
    Views:
    1,906
    David Thompson
    Mar 31, 2010
  5. joe chesak

    All contiguous subsets

    joe chesak, Mar 25, 2010, in forum: Ruby
    Replies:
    4
    Views:
    164
    joe chesak
    Mar 26, 2010
Loading...

Share This Page