Code:
int main (void)
{
struct standardDeck {
int spades[13];
int clubs[13];
int diams[13];
int hearts[13];
}
proof = {
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, },
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, },
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, },
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, }
};
const struct standardDeck PROOF = {
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, },
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, },
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, },
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, }
};
return 0;
}
Comeau C/C++ 4.3.10.1 (Oct 6 2008 11:28:09) for ONLINE_EVALUATION_BETA2
Copyright 1988-2008 Comeau Computing. All rights reserved.
MODE:strict errors C++ noC++0x_extensions
"ComeauTest.c", line 9: warning: variable "proof" was declared but never referenced
proof = {
^
"ComeauTest.c", line 16: warning: variable "PROOF" was declared but never referenced
const struct standardDeck PROOF = {
^
In strict mode, without -tused, Compile succeeded
There is no problem with constant or variable structs being initialized the old fashioned way.