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!