This program doesnt work with CodeBlocks because its an error on line 13 (fgets).
/*
Sams teachyourself C in one hour a day
page 84 program 3
*/
#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;
}
Please help me, its a program from a smart C book and I wonder why it does not work?
 
    