I did the listing as:
enum class KeyPressSurfaces { KEY_PRESS_SURFACE_DEFAULT, KEY_PRESS_SURFACE_UP, KEY_PRESS_SURFACE_DOWN, KEY_PRESS_SURFACE_LEFT, KEY_PRESS_SURFACE_RIGHT, KEY_PRESS_SURFACE_TOTAL };
and then I will try to define the array as I typed below, but I got an error, size of array 'KEY_PRESS_SURFACES' has non-integral type 'KeyPressSurfaces'
SDL_Surface*KEY_PRESS_SURFACES[KeyPressSurfaces::KEY_PRESS_SURFACE_TOTAL];
I understand that the error is fine, but I donβt know where to move KeyPressSurfaces to determine the constant in the enumeration.
I also understand that I can just use enum and not enum class , but it seems to me that this should work, and I want to learn how to do it.
Any answer / advice is welcome! Thanks!
source share