G
Generic Usenet Account
I am trying to compile the following sample code:
class WhatISHappeningHere
{
static const int x = 32;
static const char* yy = "Howdy";
// ...
// blah blah blah
// ...
};
My GCC compiler (g++ version 2.95.2) is giving the following misleading
compiler error:
ANSI C++ forbids in-class initialization of non-const static member
`yy'
I suspect that initialization of static data members that are not of an
integral type is not allowed in C++, but the compiler is giving a wrong
error message. Kindly confirm/refute my observation.
Thanks,
Gus
class WhatISHappeningHere
{
static const int x = 32;
static const char* yy = "Howdy";
// ...
// blah blah blah
// ...
};
My GCC compiler (g++ version 2.95.2) is giving the following misleading
compiler error:
ANSI C++ forbids in-class initialization of non-const static member
`yy'
I suspect that initialization of static data members that are not of an
integral type is not allowed in C++, but the compiler is giving a wrong
error message. Kindly confirm/refute my observation.
Thanks,
Gus