quanto vale x?codice:int array[] = { 23, 34, 12, 17, 204, 99, 16 }; #define TOTAL_ELEMENTS (sizeof(array) / sizeof(array[0])) int main() { int d= -1, x; if (d <= TOTAL_ELEMENTS-2) x = array[d+1]; return 0; }
a spanne avrei detto 23, invece torna 0, ovvero -1 + 1 anzichè andare a prendere l'elemento dell'array in posizione 0...
ho la febbre e la mente non lucida, ma non mi torna e vorrei capire il perchè