Hi, I'm new to C++ and I'm having trouble getting my header file to compile.
Here's the code:And heres the error:Code:--------------------------------------------------------------------------------------------------------------------- #include <iostream> #include <stdlib.h> using namespace std; class widget { private: char *label = NULL; int serNo; static int nExist, nCreated; public: widget(void); widget(const char *); widget(const widget&); ~widget(); const widget & operator = (const widget&); void print(void) const; }; #endif ---------------------------------------------------------------------------------------------------------------------\
widget.h:11: error: ISO C++ forbids initialization of member `label'
widget.h:11: error: making `label' static
widget.h:11: error: invalid in-class initialization of static data member of non-integral type `char*'
----------------------------------------------------------------------------------------------------------------------
Any help would be greatly appreciated
Thanks