This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Static Const
- From: "Paine, Thomas Asa" <PAINETA at uwec dot edu>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Mon, 21 Jul 2003 09:02:20 -0500
- Subject: Static Const
I am trying to declare a static const member like this...
class RemoteManager:public Runnable{
...
public:
...
--> static const char MANAGEMENT_INTERFACE[] = "127.0.0.1";
...
};
but when compiling, keep getting this...
g++ -g -Wno-deprecated -I /downloads/xerces/xerces-c-src_2_3_0/include/
-c remotemanager.cpp
In file included from remotemanager.cpp:7:
remotemanager.h:15: invalid in-class initialization of static data
member of
non-integral type `const char[]'
make: *** [remotemanager.o] Error 1
I'm missing something small here, but I'm not seeing it. Seems to be
object related because the same line of code in a simple main() function
works fine. Thoughts?
Thanks,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thomas Paine (paineta@uwec.edu)
University of Wisconsin - Eau Claire