CC> char string[6];
CC> strcpy(string,"12345");
CC> string[strlen(string)] = '\n';
CC> outf.write(string, strlen(string));
The bug is here. What's written to outf can be anything starting with
CC> 12345#13#10 (where #13 & #10 are ascii characters)
The strlen function depends on the terminating 0 that you have
overwritten with '\n'. In your case, the character following '\n'
happened to be 0.
Thomas
---
þ MM 1.0 #0113 þ Oops... Tried to steal my own tagline!
---------------
* Origin: McMeier & Son BBS (2:301/138)
|