array side-effect
Brett Kottmann
bkottmann at falcon.aamrl.wpafb.af.mil
Thu Jun 20 07:34:04 AEST 1991
In article <1991Jun14.184344.6066 at agate.berkeley.edu>, c60b-4fd at web-4f.berkeley.edu (Dave Zoss) writes:
> In article <91165.095327PRD3 at psuvm.psu.edu> PRD3 at psuvm.psu.edu writes:
>>I have found a real stumper.
>>Partial listing follows:
>>...
>>int CODE_MATRIX[26][25]; //global
>
> (code deleted)
>
>>This last statement changes the value of CODE_MATRIX[26][1]
>
> When declaring arrays in C or C++, the number in brackets specifies the SIZE
> of the array. The indices, therefore, range from 0 to SIZE-1.
>
> The cell CODE_MATRIX[26][1] does not exist.
>
What a great exam question (or employee quiz)!!!!
;)
Brett
=============================OFFICIAL=DISCLAIMER================================
The opinions and views expressed here are strictly my own and do not
necessarily reflect the official position of either the U.S. Air Force
or its contractors.
=====================DO=NOT=REMOVE=TAG=UNDER=PENALTY=OF=LAW===:)================
More information about the Comp.lang.c
mailing list