-> RA> eg:
RA> char name[40];
RA> gets(name);
If you do that verbatim, you will have an overflow problem with all
known compilers. This is how that should be:
char name[40];
gets(name);
name[40]='\n';
You have to put a NULL on the end or it will have an overflow problem.
I believe you have to do that with 'fgets' as well..
Just put the null character on the very end of the array.
Hope you like my advice. Peace!
-Dave van Hoose
1:3612/333
333:1/1
--- PCBoard (R) v15.3 (OS/2) 100
---------------
* Origin: Destiny BBS: LightBar Central (1:3612/333)
|