Why and how gcc emits warning for gets()?
while(1) { printf("\nEnter message : "); gets(message); //Send some data if( send(sock , message , strlen(message) , 0) < 0) { puts("Send failed"); return 1; } //Receive a reply from the server if( recv(sock , server_reply , 2000 , 0) < 0) { puts("recv failed"); break; } puts("Server reply :"); puts(server_reply); } close(sock); return 0; } This is part of my program. When I compile and run it, I get an error. The error's message is warning: the gets function is dangerous and should not be used! Shreevardhan A simple google search would have given a lot of useful information like this answer.