On Jan 29, 7:01 am, RezaRob <Reza...@gmail.comwrote:
I don't know if this is ANSI-C, but in gcc it works perfectly well:
static const char *opcodes[] = {
[3] = "bad_op"
};
However, in c++ it fails! What's the deal?
It's legal ISO C (according to ISO/IEC 9899::1999), but not
legal ISO C++ (according to ISO/IEC 14882:2003).
As far as I know, this part of C99 will not be adopted into the
next version of C++. (I don't know why. In the case of
structures, it's particularly useful, and generally speaking,
aggregate initialization in C++ is very strongly based on C.)
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34