View Single Post
Old 09-06-2008, 06:22 AM
kodyazan kodyazan is offline
Senior Member
Join Date: Jul 2008
Posts: 60

if you only want "abc" without enter (\n), you may use
instead of
fgets(&buff[0] , Length ,stdin);

And be carefull when using gets().

If someone enters 500 characters, your program above, will -mostly- crash.
(gets() doesn't check buffer overflow. fgets() is safer).

Last edited by kodyazan : 09-06-2008 at 05:53 PM.
Reply With Quote