New to C++, Header File Error
Hi, I'm new to C++ and I'm having trouble getting my header file to compile.
Here's the code:
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
---------------------------------------------------------------------------------------------------------------------\
And heres the error:
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