I'm a beginner in C++ so I'm sorry if this is super obvious, but I have an issue with assigning values to an enum. I've declared the enum like so in a header file:
enum face
{ paramControlHeight = 40,
paramLabelWidth = 80,
paramSliderWidth = 300
};
And tried assigning an integer. Needless to say it doesn't work:
paramControlHeight = 40;//Not assignable
After googling about for a while, I tried:
using type_of_p=decltype(paramControlHeight);
Which as I understand, should yield the type of paramControlHeight, and enable me to use
paramControlHeight=static_cast<type_of_p> (40);
But I get the same "un-assignable" error
If anyone could point me in the right direction I'd be very grateful
faceand assign value40to it?paramControlHeightis a constant. You assign variables with it:auto var = paramControlHeight;You can't assign new values to a constant.int paramControlHeight = 40) to be able to change it.