arrays - Alternative to designated initializers in C++ -
the style of code using designated initializers below belongs c language
int widths[] = { [0] = 1, [10] = 2, [100] = 3 };
i know, there way write such simple code in c++?
in c++ have write
int widths[101] = { 1 }; widths[10] = 2; widths[100] = 3;
Comments
Post a Comment