3.3.27. Subscripting struct

In ISO C99, arrays that are not lvalues still decay to pointers, and can be subscripted. However, you must not modify or use them after the next sequence point, and you must not apply the unary & operator to them. Arrays of this kind can be subscripted in C89 mode, but they do not decay to pointers outside C99 mode.

struct Subscripting_Struct {int a[4];};

extern struct Subscripting_Struct Subscripting_0(void);

int Subscripting_1 (int index)
{
    return Subscripting_0().a[index];
}

Supported in GNU mode and ARM mode.

Copyright © 2002-2006 ARM Limited. All rights reserved.ARM DUI 0205G
Non-Confidential