Question: Here *len* is at A[10] and *i* is at A[11]. Is there a way to catch these errors??
I tried compiling with gcc -Wall -W but no warnings are displayed.

```
int main()
{
  int A[10];
  int i, len;
  len = sizeof(A) / sizeof(0[A]);
  printf("Len = %d\n",len);
  for(i = 0; i < len; ++i){
    A[i] = i*19%7;
  }
  A[i] = 5;
  A[i + 1] = 6;
  printf("Len = %d i = %d\n",len,i);
  return 0;
}

```

**Output :**
Len = 10
Len = 5 i = 6

Answer: 
C does not generally do bounds-checking, but a number of people have implemented bounds-checking for C. For instance there is a patch for GCC at <http://sourceforge.net/projects/boundschecking/>. Of course bounds-checking does have some overhead, but it can often be enabled and disabled on a per-file basis.
i's location in memory is just past the end of A. That's not guaranteed with every compiler and every architecture, but most probably wouldn't have a reason to do it any other way. 

Note that counting from 0 to 9, you have 10 elements.