I'm trying to create my first class but I keep getting an error at compile for each of the 4 shapes in the class member, shape. Error
1 2 3 4
documents\visual studio 2008\projects\template\template\template.cpp(47) : error C2864: 'shapes::circle' : only staticconst integral data members can be initialized within a class
1>c:\users\\\documents\visual studio 2008\projects\template\template\template.cpp(47) : error C2864: 'shapes::square' : only staticconst integral data members can be initialized within a class
1>c:\users\\\documents\visual studio 2008\projects\template\template\template.cpp(47) : error C2864: 'shapes::triangle' : only staticconst integral data members can be initialized within a class
1>c:\users\\\documents\visual studio 2008\projects\template\template\template.cpp(47) : error C2864: 'shapes::rectangle' : only staticconst integral data members can be initialized within a class
You aren't allowed to define member variables in this way unless they are const static (meaning they can't change, and all class objects share the same values).