...
Non-Compliant Code Example (Implicit Size)
This non-compliant code example initializes In this example, the compiler allocates an array of integers using an initialization with too many elements for the array4 integer elements, and sets the array bound to 4, since no bound is specified. However, if the initializer changes, the array bound may also change, causing unexpected results.
Code Block | ||
---|---|---|
| ||
int a[] = {1, 2, 3, 4}; |
...
Compliant Solution
This compliant solution explicitly specifies the array dimension.
...