I'm curious about the following. I have a simple C array declared in a header file like this:
static int userCardsIndexes[INITIAL_CARDS_NUMBER] = {0, 1, 8, 9, 16, 17};
it gives me a bunch of the warnings:
: 'userCardsIndexes' defined but not used
despite i include this file into my cpp files and use this variable. The second thing that i don't understand about it is when i add const
specifier like this:
static const int userCardsIndexes[INITIAL_CARDS_NUMBER] = {0, 1, 8, 9, 16, 17};
the warnings disappear! Can anyone give me an explanation why i get these warnings and why const
removes them?