I am interested in the following. I have a simple C array declared in the header file as follows:
static int userCardsIndexes[INITIAL_CARDS_NUMBER] = {0, 1, 8, 9, 16, 17};
he gives me a bunch of warnings:
: 'userCardsIndexes' defined but not used
even though I include this file in my cpp files and use this variable. Secondly, I do not understand this when I add the const specifier as follows:
static const int userCardsIndexes[INITIAL_CARDS_NUMBER] = {0, 1, 8, 9, 16, 17};
warnings disappear! Can someone give me an explanation why I get these warnings and why const removes them?
Andrey Chernukha
source share