freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

linux下學(xué)生信息管理系統(tǒng)設(shè)計(jì)報(bào)告-資料下載頁

2025-05-13 22:08本頁面
  

【正文】 oi(buf)。 while(head!=NULL) { if(number==headnumber) { sprintf(buf,\n number: %4d name: %6s sex: %c age: %2d password: %6s %10s %3d %10s %3d\n,headnumber,headname,headsex,headage,headpassword,(headstu_sub[0]).sub_name,(headstu_sub[0]).score,(headstu_sub[1]).sub_name,(headstu_sub[1]).score)。 send(client_fd,buf,strlen(buf)+1,0)。 usleep(1000)。 break。 } head=headnext。 } if(head==NULL) { send(client_fd,Find none!\n,strlen(Find none!\n)+1,0)。 usleep(1000)。 }2)刪除學(xué)生信息void delete_student(type_stu **head,int client_fd) { //if only one node existed in the linklist,delete operation will clear all data in this node if( (*head)next==NULL ) { send(client_fd,Only one node existed,delete operation will clear all data in this node.\n,strlen(Only one node existed,delete operation will clear all data in this node.\n)+1,0)。 usleep(1000)。 memset(*head,0,sizeof(type_stu))。 } int number。 char buf[BUFSIZ]。 send(client_fd,Input number to delete: \n,strlen(Input number to delete: \n)+1,0)。 recv(client_fd,buf,BUFSIZ,0)。 number=atoi(buf)。 pthread_mutex_lock(amp。mut)。 type_stu *prev=*head,*head_temp=*head。 while(*head!=NULL) { if((*head)number==number) //if the node to delete is head of linklist { if(head_temp==*head) { *head=(*head)next。 free(head_temp)。 } else { prevnext=(*head)next。 free(*head)。 *head=head_temp。 } send(client_fd,Delete success!\n,strlen(Delete success!\n)+1,0)。 usleep(1000)。 break。 } prev=*head。 *head=(*head)next。 } pthread_mutex_unlock(amp。mut)。 if(*head==NULL) //if the node to delete not exist { *head=head_temp。 send(client_fd,Find none!\n,strlen(Find none!\n)+1,0)。 usleep(1000)。 } }3)修改學(xué)生信息void modify_student(type_stu *head,int client_fd){ char buf[BUFSIZ]。 int i=0,j=0,k=0。 int number。 send(client_fd,Input number to modify: \n,strlen(Input number to modify: \n)+1,0)。 recv(client_fd,buf,BUFSIZ,0)。 number=atoi(buf)。 type_stu *prev=head。 while(head!=NULL) { if(headnumber==number) { sprintf(buf,\n number: %4d name: %6s sex: %c age: %2d password: %6s\n,headnumber,headname,headsex,headage,headpassword)。//按需輸入要修改的學(xué)生信息 strcat(buf,Input new number,name,sex,age,password:\n)。 send(client_fd,buf,strlen(buf)+1,0)。 recv(client_fd,buf,BUFSIZ,0)。 pthread_mutex_lock(amp。mut)。 headnumber=atoi(buf)。 for(i=0。iBUFSIZ。i++) { if(buf[i]==39。 39。) { j++。 if(j==1) { while( buf[i+1+k] !=39。 39。 ) { *(headname+k)=buf[i+1+k]。 k++。 } *(headname+k)=39。\039。 } else if(j==2) headsex=buf[i+1]。 else if(j==3) headage=atoi(buf+i+1)。 else if(j==4) strcpy(headpassword,buf+i+1)。 else break。 } } pthread_mutex_unlock(amp。mut)。 break。 } head=headnext。 } if(head==NULL) { send(client_fd,Find none!\n,strlen(Find none!\n)+1,0)。 usleep(1000)。 }三、測(cè)試與總結(jié)登錄界面管理員功能模塊學(xué)號(hào)的搜索查詢學(xué)生登錄修改密碼教師登錄感悟 通過這次課程設(shè)計(jì)加深了對(duì)Socket的理解和認(rèn)識(shí),在設(shè)計(jì)的過程中,對(duì)C語言進(jìn)行了系統(tǒng)的復(fù)習(xí),也解決了以前一些模糊的問題,加深了對(duì)C語言的認(rèn)識(shí)和應(yīng)用,進(jìn)一步熟悉了Linux操作系統(tǒng)的操作以及Gcc的應(yīng)用。雖然系統(tǒng)設(shè)計(jì)的過程很艱難,但是收獲還是很多。
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1