Extended initializer lists only available with -std=c++0x or -std=gnu++0x

You may get error "Extended initializer lists only..." while you are compiling your C++ code. This error is encountered when you are trying to assign the elements of the array as:
     array[10]={9,8,7,6,5,4,3,2,1,0};

Which you have already declared some where in your code as
    int array[10];  

You can only specify the initialization list during declaration of the array hence the error, if you want to assign the values somewhere else in your code except declaration then use the for loop or direct assignment at particular index such as
    for(int i =0; i< 10; ++i)
        array[i] = value;
or
    array[0] = value0;
    .
    .
    .
    array[9] = value9;
   

Hope this helps...

Comments

Popular posts from this blog

How to flash CWM Recovery to Samsung Galaxy SL( GT-I9003) using Odin

How to boot Samsung Galaxy SL( GT-I9003) in recovery mode

Exception handling with RestTemplate