From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Whatever Date: Mon, 01 Sep 1997 23:36:06 +0000 Organization: Two pounds of chaos and a pinch of salt Lines: 25 Message-ID: <340B5166.52B1@cs.com> References: <19970825183100 DOT OAA00811 AT ladder02 DOT news DOT aol DOT com> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp109.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Mike4148 wrote: > > Hey, I'm a veteran. In BTC++ 3.0 the little array index number you > initialize an array with was the last element number. I'm not getting the > book, by the way :). Then this compiler was not a standard C++ compiler. An array of size n is indexed 0..(n-1). This is an immutable rule of the C language. Real mode programs have less safeguards against illegal memory accesses than protected mode programs, so it's quite possible that you could access invalid array elements without causing an immediate crash. This does not mean that it didn't screw up something else in the program; in fact, the chances of this are quite high. Ironically, variable alignment in 32-bit programs might occasionally make it safer to access that 'nth' array element, because of the "dead" space at the end of the block of memory. :) -- --------------------------------------------------------------------- | John M. Aldrich | "Courage is the complement of fear. | | aka Fighteer I | A man who is fearless cannot be | | mailto:fighteer AT cs DOT com | courageous. (He is also a fool.)" | | http://www.cs.com/fighteer | - Lazarus Long | ---------------------------------------------------------------------