第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

運(yùn)行C語(yǔ)言出現(xiàn)了錯(cuò)誤,該怎么解決?

運(yùn)行C語(yǔ)言出現(xiàn)了錯(cuò)誤,該怎么解決?

C
qq_莫非 2017-09-24 17:48:10
Compiling...mthreadserver.ce:\course\c語(yǔ)言\mthreadserver.c(2) : fatal error C1083: Cannot open include file: 'strings.h': No such file or directoryError executing cl.exe.mthreadserver.obj - 1 error(s), 0 warning(s)#include?<stdio.h> #include?<strings.h> #include?<unistd.h> #include?<sys/types.h> #include?<sys/socket.h> #include?<netinet/in.h> #include?<arpa/inet.h> #define?PORT?1234 #define?BACKLOS?5 #define?MAXDATASIZE?100 void?process_cli(int?connfd,struct?sockaddr_in?client); int?main(){ ????int?listenfd,connfd; ????pid_t?pid; ????struct?sockaddr_in?server; ????struct?sockaddr_in?client; ????int?len; ????if((listenfd=socket(AF_INET,SOCK_STREAM,0))==-1){ ????????perror("Creating?sock?falied"); ????????exit(1); ????} ????int?opt=SO_REUSEADDR; setsockopt(listenfd,SOL_SOCKET,SO_REUSEADDR,&opt,sizeof(opt)); bzero(&server,sizeof(server)); server.sin_family=AF_INET; server.sin_port=htons(PORT); server.sin_addr.s_addr=htonl(INADDR_ANY); if(bind(listenfd,(struct?sockaddr?*)&server,sizeof(server))==-1){ perror("Bind?error"); exit(1); } if(listen(listenfd,BACKLOG)==-1){ perror("listen()?error\n"); exit(1); } len=sizeof(client); while(1){ if((connfdf=accept(listenfd,(struct?sockaddr?*)&client,&len))==-1){ perror("accept()?error\n"); exit(1); } if((pid=fork())>0){ close(connfd); continue; }else?if(pid==0){ close(listenfd); process_cli(connfd,client); exit(0); }else{ printf("fork()?error\n"); exit(0); } } close(listenfd); } void?process_cli(int?connfd,struct?sockaddr_in?client){ int?num; char?recvbuf[MAXDATASIZE],sendbuf[MAXDATASIZE],cli_name[MAXDATASIZE]; printf("You?got?a?connection?from?%s."inet_ntoa(client.sin_addr)); num=recv(connfd,cli_name,MAXDATASIZE,0); if(num==0){ close(connfd); printf("Client?disconnected.\n"); return; } cli_name[num-1]='\0'; printf("Client's?name?is?%s.\n",cli_name); while(num=recv(connfd,recvbuf,MAXDATASIZE,0)){ recvbuf[num]='\0'; printf("Received?client(%s)?message:%s",cli_name,recvbuf); int?i=0; for(i=0;i<num-1;i++){ if((recvbuf[i]>='a'&&recvbuf[i]<='z')||(recvbuf[i]>='A'&&recvbuf[i]<='Z')){ recvbuf[i]=recvbuf[i]+3; if((recvbuf[i]>'Z'&&recvbuf[i]<='Z'+3)||recvbuf[i]>'z') recvbuf[i]=recvbuf[i]-26; } sendbuf[i]=recvbuf[i]; } sendbuf[num-1]='\0'; send(connfd,sendbuf,strlen(sendbuf),0); } close(sonnfd); }
查看完整描述

1 回答

?
onemoo

TA貢獻(xiàn)883條經(jīng)驗(yàn) 獲得超454個(gè)贊

其實(shí)編譯器的報(bào)錯(cuò)已經(jīng)告訴你了,它說(shuō)找不到頭文件?strings.h。你拼錯(cuò)了,這個(gè)頭文件是 string.h

查看完整回答
1 反對(duì) 回復(fù) 2017-09-24
  • 1 回答
  • 0 關(guān)注
  • 1451 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)