Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:C Extensions   [Contents][Index]


6.23 Non-Lvalue Arrays May Have Subscripts

In ISO C99, arrays that are not lvalues still decay to pointers, andmay be subscripted, although they may not be modified or used afterthe next sequence point and the unary ‘&’ operator may not beapplied to them. As an extension, GNU C allows such arrays to besubscripted in C90 mode, though otherwise they do not decay topointers outside C99 mode. For example,this is valid in GNU C though not valid in C90:

struct foo {int a[4];};struct foo f();bar (int index){  return f().a[index];}

[8]ページ先頭

©2009-2025 Movatter.jp