E
Eric Lilja
Is this an invalid program? Doesn't compile on my system:
#include <cstdio>
class Why
{
enum TArch {LITTLE_ENDIAN, BIG_ENDIAN, NON_IEEE};
TArch Architecture;
};
int
main()
{
Why ohwhy;
}
$ g++ -Wall -W -ansi -pedantic -c whynotwork.cpp
whynotwork.cpp:5: error: expected identifier before numeric constant
whynotwork.cpp:5: error: expected `}' before numeric constant
whynotwork.cpp:5: error: expected unqualified-id before numeric
constant
whynotwork.cpp:6: error: `TArch' does not name a type
whynotwork.cpp:6: error: extra `;'
whynotwork.cpp:7: error: expected declaration before '}' token
/ E
#include <cstdio>
class Why
{
enum TArch {LITTLE_ENDIAN, BIG_ENDIAN, NON_IEEE};
TArch Architecture;
};
int
main()
{
Why ohwhy;
}
$ g++ -Wall -W -ansi -pedantic -c whynotwork.cpp
whynotwork.cpp:5: error: expected identifier before numeric constant
whynotwork.cpp:5: error: expected `}' before numeric constant
whynotwork.cpp:5: error: expected unqualified-id before numeric
constant
whynotwork.cpp:6: error: `TArch' does not name a type
whynotwork.cpp:6: error: extra `;'
whynotwork.cpp:7: error: expected declaration before '}' token
/ E