[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Arrays of Zero Length in Structures

If the ANSI Strict option is off in the C/C++ Language Panel, the compiler allows arrays of no length as the last item in a structure. Listing 3.5 shows an example. Arrays may be defined with a zero as the index value or with no index value between brackets.
Using zero-length arrays:
struct listOfLongs {
long listCount;
long list[0]; // OK if ANSI Strict is off, [] is OK, too.
}
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 17, 2000