Ok think about 2 arrays declared in sequence...
These will be in memory like this...Code:char a[16], b[16];
C does not do range checking... so you can easily walk off the end of one array into the beginning of the next...Code:AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBB
So now you are writing to a[i] but actually changing the contents of array b.Code:AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBB xxxxxxxxxxxxxxxxxxxxxxxx