When I try to initialize the char variable in my class it gives the error message in title, but if I create the variable in main it is fine? Can anyone see the problem?
1>c:\users\alex\documents\visual studio 2012\projects\consoleapplication68\consoleapplication68\source.cpp(20): error C2864: 'UserName::fullStop' : only static const integral data members can be initialized within a class
Problem solved, I was hovering over the error on the variable fullStop and it give me the error message "Error: data member initializer is not allowed". I didn't compile it until just now but I think static is a type of data users give to the computer, I don't need to initialize that variable fullStop in the constructor do I? :D
> staticconstchar fullStop = '.';
that has a different meaning.
Now is a class property (shared along all the objects of that class), and can't be changed.