Consider
#include<stdio.h>
int main()
{
char buffer[100];
gets(buffer);
printf("The input is %s",buffer);
}
When user types input of length within 99 then there is no problem. But when user types more than 99 characters it tries to write into memory it doesn't own.
The worst thing is it causes abnormal behaviour and the program terminates without any information which leaves user baffled about the current situation
An alternative way is to use char *fgets(char *s, int size, FILE *stream);
function
Update: As pointed by @pmg : gets()
removes newline while fgets()
retains the new line