It is now recommended that fgets() be used in place of the gets() function that has been marked as deprecated. So the example on page 110/111 of “C Programming in easy steps” should appear as:
#include <stdio.h>
int main()
{
char str[51] ;
printf( “\nEnter up to 50 characters with spaces:\n” ) ;
fgets( str, sizeof( str ), stdin);
printf( “fgets() read: ” ) ;
puts( str ) ;
printf( “\nEnter up to 50 characters with spaces:\n” ) ;
scanf( “%s”, str ) ;
printf( “scanf() read: %s\n” , str ) ;
return 0 ;
}