I have some arrays that are declared like this:
static double covalent_radius[256] = {
[ 0 ] = 0.85,
[ 1 ] = 0.37,
...
};
C++ doesn't allow this kind of declaration. Is there any way to achieve this?
static double covalent_radius[256] = {
0.85, /* ?, Unknown */
0.37, /* H, Hydrogen */
...
};
It's C89, not C99 so I suppose it should work.
Why don't you do this:
static double covalent_radius[256] = {
0.85, /* 0: ?, Unknown */
0.37, /* 1: H, Hydrogen */
...
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With