I'm new to CPP, can't find a simple documentation on how to declare a private constant class attribute, and if it should go on the .h or .m
Here's what I have on my Horse.h:
class Horse {
private:
static const int body_vertex_quantity = 24;
float left_ear_vertex_array[ears_vertex_quantity][2] = {
//
};
public:
draw();
}
But I'm getting
cannot specify explicit initializer of arrays
I have made my research in the following links, but I don't understand the syntax or what they're doing since I'm new to cpp
Initializing a member array in constructor initializer
Error: cannot specify explicit initializer for array
Workaround for error C2536: cannot specify explicit initializer for arrays in Visual Studio 2013
asked Sep 4, 2014 at 20:57
Christopher Francisco
16.4k31 gold badges110 silver badges222 bronze badges
lang-cpp
static.left_ear_vertex_array { // }in the member initializer list of a constructor function, not in the declaration!float left_ear_vertex_array[24][2]std::vector