array decay

Discussion in 'C Programming' started by Mantorok Redgormor, Oct 8, 2003.

  1. Can someone point out the section in the standard where it says arrays
    decay and where elements of a multi dimensional array decay into
    pointer to ints too? Like int array[10][10]; array[0] decays to
    pointer to int. Where is this stated in the standard?
     
    Mantorok Redgormor, Oct 8, 2003
    #1
    1. Advertising

  2. Mantorok Redgormor

    pete Guest

    Mantorok Redgormor wrote:
    >
    > Can someone point out the section in the standard where it says arrays
    > decay and where elements of a multi dimensional array decay into
    > pointer to ints too? Like int array[10][10]; array[0] decays to
    > pointer to int. Where is this stated in the standard?


    N869
    6.3.2.1 Lvalues and function designators
    [#3] Except when it is the operand of the sizeof operator or
    the unary & operator, or is a string literal used to
    initialize an array, an expression that has type ``array of
    type'' is converted to an expression with type ``pointer to
    type'' that points to the initial element of the array
    object and is not an lvalue. If the array object has
    register storage class, the behavior is undefined.

    --
    pete
     
    pete, Oct 9, 2003
    #2
    1. Advertising

  3. On 8 Oct 2003 12:54:42 -0700, (Mantorok Redgormor)
    wrote:

    >Can someone point out the section in the standard where it says arrays
    >decay and where elements of a multi dimensional array decay into
    >pointer to ints too? Like int array[10][10]; array[0] decays to
    >pointer to int. Where is this stated in the standard?


    Paragraph 3 of section 6.3.2.1 (in the n869 draft).


    <<Remove the del for email>>
     
    Barry Schwarz, Oct 9, 2003
    #3
    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. Mantorok Redgormor

    array decay

    Mantorok Redgormor, Sep 23, 2003, in forum: C Programming
    Replies:
    1
    Views:
    397
    Kevin Bracey
    Sep 23, 2003
  2. pandapower

    array to pointer decay question !!

    pandapower, Feb 2, 2004, in forum: C Programming
    Replies:
    5
    Views:
    571
    Horst Kraemer
    Feb 2, 2004
  3. frederik aa de jonge

    module for calculations involving radioactive decay?

    frederik aa de jonge, Nov 2, 2006, in forum: Python
    Replies:
    0
    Views:
    406
    frederik aa de jonge
    Nov 2, 2006
  4. m sergei

    array to pointer decay question !!

    m sergei, Jun 30, 2004, in forum: C Programming
    Replies:
    6
    Views:
    438
    Dan Pop
    Jul 1, 2004
  5. Snis Pilbor

    Question about function decay

    Snis Pilbor, Aug 4, 2006, in forum: C Programming
    Replies:
    5
    Views:
    283
    Flash Gordon
    Aug 5, 2006
Loading...

Share This Page