> Array[4]; // this is going to store 5 byte starting 0,1,2,3,4 No, it stroes 4 bytes! > Array[5]; // that doesn't exist what do you expect compiler to do? not even Array[4] !!! onl Array[3] --> 4 bytes, from index 0..3 ..... As a discussion on another thread on ugly and bad C, C does not have any validation in compile time nor in run-time... So that is valid in C to say Array[5], however, will point to somewhere in memory the programmer did not want to. Tamas On Tue, Oct 21, 2008 at 6:56 PM, Andre Abelian wrote: > Hi to all, > > At work one of our software engineer made fallowing mistake but he > blames on compiler but I keep telling him that that's no thing to do > with compiler > He disagrees. > > Suppose array is 5 byte long > > Array[4]; // this is going to store 5 byte starting 0,1,2,3,4 > > So if I use > > Array[0]; // it will use first byte > > But if I use > > Array[5]; // that doesn't exist what do you expect compiler to do? > > If compiler is smart enough to report this kind of errors that will be > nice > But in reality it is typo. > > My question is what do you expect for compiler to do? It is a compiler > bug or typo? > > Thanks > > Andre > > IMPORTANT NOTICE: This notice constitutes Proprietary Rights identification > of this email including all attachments, which is property that is intended > only for the use of the individual or entity to which it is addressed. It > also may contain proprietary data or information that is privileged, > confidential, or otherwise protected from disclosure under applicable law. > The recipient of this data agrees to abide by the United States Export > Control of Technical Data and Equipment under the International Traffic in > Arms Regulations (ITAR) and Export Administration Regulations (EAR). The > recipient agrees to abide by these laws and their regulations not only for > export and re-export, but for disclosure to non-U.S. citizens. This email > does not grant or assign rights of ownership in the proprietary subject > matter herein, nor shall it be construed as a joint venture, partnership, > teaming agreement, or other formal business relationship. If the reader of > this e-mail transmission! > is not the intended recipient or the employee or agent responsible for > delivering the transmission to the intended recipient, you are hereby > notified that any dissemination, distribution, copying or use of this e-mail > or its contents is strictly prohibited. Please notify the sender you > received it in error by responding to the e-mail and then permanently delete > it and all copies of the e-mail immediately, including any copies of it in > your deleted email folder. > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- Rudonix DoubleSaver http://www.rudonix.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist