On Sat, Jan 09, 1999 at 10:41:21AM -0600, Richard Ivanowich wrote:
> Hello all,
> 
> Now i know arrays do no bound checking.  How would i make it do bound
> checking?
> 

Why would you need bound checking? You know the size of the array
because you declared it, just write the loop accordingly.

BTW, your loop is wrong

> ie.  int array[10];
> 
> for(i=0;i<=11;i++) {
>   array[i]=i;
> }
> 

It should be

        for (i = 0; i < 10; i++) {
                array[i] = i;
        }

Your index range is from 0 to 9.

Reply via email to