The following tests are made on solaris 5.10 platform. This is the example of the decrement(--) for short index of array: /*********************************************************/ #include <stdio.h> int main() { int aryHuowq[3] = {0}; short nIndex = 2; /* nIndex is short */ aryHuowq[nIndex--] = nIndex + 1; printf("array[%d] : %d\n", nIndex+1, aryHuowq[nIndex+1]); return 0; } /*****************************************************************/ /* The result is "array[2] : 2", but it should be "array[2] : 3" */ /*****************************************************************/ If nIndex is type of int, then the result is "array[2] : 3".
Created attachment 19559 [details] The source of wrong result of decrement, increment is the same The result is wrong.
*** This bug has been marked as a duplicate of 11751 ***