Xref: utzoo comp.lang.c:40070 comp.lang.c++:14094 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!agate!web-4f.berkeley.edu!c60b-4fd From: c60b-4fd@web-4f.berkeley.edu (Dave Zoss) Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: array side-effect Message-ID: <1991Jun14.184344.6066@agate.berkeley.edu> Date: 14 Jun 91 18:43:44 GMT Article-I.D.: agate.1991Jun14.184344.6066 References: <91165.095327PRD3@psuvm.psu.edu> Sender: usenet@agate.berkeley.edu (USENET Administrator) Organization: University of California, Berkeley Lines: 16 In article <91165.095327PRD3@psuvm.psu.edu> PRD3@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. Dave Zoss zoss@ocf.berkeley.edu zoss@icf.llnl.gov