3.7.9. Initializers

As in standard C++ and ISO C99, the elements of an aggregate initializer for an automatic variable are not required to be constant expressions.

Mode

Supported in GNU mode only for C90.

Example

float Initializers_0 (float f, float g)
{
    float beat_freqs[2] = { f-g, f+g };
    float aLocal;
    int i=0;

    for (; i<2; i++)
        aLocal += beat_freqs[i];
    return aLocal;
}
Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential