rendered paste body//client.c
#include<stdio.h>
#include<unistd.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#include<netdb.h>
int main(int argc, char* argv[])
{
int sd;
struct sockaddr_in servadd;
socklen_t len;
char buff[100];
sd=socket(AF_INET,SOCK_STREAM,0);
bzero(&servadd,sizeof(servadd));
servadd.sin_family=AF_INET;
servadd.sin_addr.s_addr=htonl(INADDR_ANY);
servadd.sin_port=htons(5000);
connect(sd,(struct sockaddr*)&servadd,sizeof(servadd));
while(1)
{
bzero(&buff,sizeof(buff));
fgets(buff,sizeof(buff),stdin);
send(sd,buff,sizeof(buff),0);
}
close(sd);
return 0;
}