This is what I use to send to the socket.
Code:
void write_to_socket(char * buf)
{
send(sockfd, buf, strlen(buf),0);
return;
}
this is how i get the info to send and use write_to_socket.
Code:
//Name
printf("Name for character?\n\r");
fgets(name, sizeof(name), stdin);
if (name == '\0')
{
printf("Name was blank.\n\r");
}
else
{
write_to_socket(name);
write_to_socket(answer);
}
//Password
printf("Give us a password.\n\r");
{
fgets(password,sizeof(password),stdin);
write_to_socket(password);
write_to_socket(password);
}
I get the problem when i'm sending the password. I need to send it twice to verify it. Then we enter the smiley and division sign.