Hi guys, I'm currently teaching myself c via 'Sams Teach yourself C Programming in one hour a day'(Seventh Edition). I'm not sure if this is an error in the book or I'm typing something wrong but for some reason this code will not compile, and shows an error "'too few arguments to function 'fgets'"
What would be the proper way to write this code? Thanks for the help.
Code:
/* ex02-05.c */
#include <stdio.h>
#include <string.h>
int main(void)
{
char buffer[256];
printf( "Enter your name and press <Enter>:\n");
fgets( buffer );
printf( "\nYour name has %d characters and spaces!",
strlen( buffer ));
return 0;
}