I used C before (inline material) and I can initialize my arrays as follows:
int widths[] = { [0 ... 9] = 1, [10 ... 99] = 2, [100] = 3 };
i.e. I can specify indexes inside the initializer. I am currently learning Qt/C++ , and I cannot believe that this is not supported in C ++.
I have this option: -std=gnu++0x , but in any case it is not supported. (I don't know if this is supported in C ++ 11 because Qt is working with an error with gcc 4.7.x)
So, is this not really supported in C ++? Or maybe there is a way to turn it on?
UPD: Currently, I want to initialize a const array, so std::fill will not work.
c ++ c
Dmitry Frank
source share