>
> char string[4];
> string="OUCH";
BB> This itself is a disaster waiting to happen. Not
BB> only has it created both an instant type qualifier
BB> conflict and an array which is one element too small,
BB> but it has also attempted to change the fixed address
BB> of the array by assigning to it the address of a string
BB> constant. Whoever did this does not understand what he
BB> is doing.
I'm not sure if you read the rest of John's message or not, but he was
looking for ways to PREVENT this type of thing from happening, although his
example was poor in that this is an example of something that cannot happen
(due to an attempt to assign to string rather than using strcpy).
He wanted some automated way to determine if he was about to overwrite an
array boundary. Unfortunately, in C, there is no such beast.
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)
|