-> First of all '\n' is not a NUL character (BTW, NULL should be used to
-> refer to a pointer, although I'm aware that in C++ you can get away
-> with it), you should use '\0' or plain 0.
Refer to a message I wrote to Roger Scudder. I made a typo in my
example. Again, this is what it is supposed to be:
char name[40];
gets(name);
name[40]='\0';
gets() does not using Borland, GNU, Microsoft, or Watcom compilers, put
a '\0' (NULL) on the end to signify that it has filled the character
array to the max. Try it.. I have using straight C.
-Dave
1:3612/333
333:1/1
davidvh@ibm.net
--- PCBoard (R) v15.3/100
---------------
* Origin: Destiny BBS: LightBar Central (1:3612/333)
|