array decay

  • Thread starter Mantorok Redgormor
  • Start date
M

Mantorok Redgormor

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?
 
P

pete

Mantorok said:
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.
 
B

Barry Schwarz

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>>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top