BB> Darin,
> JD> char string[4];
> JD> string="OUCH";
DM > You mean:
DM > strcpy(string, "OUCH");
BB> No. "OUCH" is 5 chars long; string[] is four. Quart
BB> into pint pot syndrome.
> The operator = won't work here.
BB> True, but nothing at all will cope with these circumstances. :-)
Bill, you have to read the rest of the message I was responding to: the point
of the excercise was to find out why C wasn't doing that protection, so we
had to leave in the bad code for that purpose. However, it still had to be
compilable code...
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)
|