Static Const

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx)
University of Wisconsin - Eau Claire


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux