資源描述:
《交叉編譯器的使用》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、頭文件Stud_mgr_system.h內(nèi)容如下:#ifndefSTUD_MGR_SYSTEM_H#defineSTUD_MGR_SYSTEM_H#include#include#include#includestructstud_mgr_sys{intnum;charname[8];charphone[12];charaddr[12];structstud_mgr_sys*front;structstud_mgr_sys*back;};typedefstructstud_mgr_sysstudent;typed
2、efstudent*DoubleLink;voidprintlist(DoubleLinkL);DoubleLinkaddnode(DoubleLinkL);DoubleLinkdeletenode(DoubleLinkL);DoubleLinkfindinfo(DoubleLinkL,intnum);DoubleLinkmodifyinfo(DoubleLinkL);DoubleLinkcreatdoublelink();voidmenu();voidsecrecy();DoubleLinkread_file(DoubleLinkL);voidsave_file(DoubleLinkL)
3、;#endif源文件opt_sys_api.c內(nèi)容如下:#include"stud_mgr_system.h"voidprint_err(char*p){perror("p");exit(1);}voidprintlist(DoubleLinkL){DoubleLinktmp;tmp=L;printf("******************************************");while(tmp!=NULL){printf("tThestudentnumber:%d",tmp->num);printf("tThestudentname:%s",tmp->
4、name);printf("tThestudentphone:%s",tmp->phone);printf("tThestudentaddr:%s",tmp->addr);printf("");tmp=tmp->front;}printf("******************************************");getchar();}DoubleLinkcreatdoublelink(){DoubleLinkhead;DoubleLinknew_node,before;intcount,i;head=(DoubleLink)malloc(sizeo
5、f(student));if(!head)print_err("Failtomallochead");head->front=NULL;before=head->front;printf("Inputnumberyouwanttocreate==>");scanf("%d",&count);for(i=1;i<=count;i++){new_node=(DoubleLink)malloc(sizeof(student));if(!new_node)print_err("Failtomallocnew_node");printf("%d,TheNumber==>",i);scanf("%d"
6、,&new_node->num);printf("%d,TheName==>",i);scanf("%s",new_node->name);printf("%d,ThePhone==>",i);scanf("%s",new_node->phone);printf("%d,TheAddr==>",i);scanf("%s",new_node->addr);printf("");new_node->front=NULL;if(head->front==NULL){head->front=new_node;before=head->front;before->back=head;}else{
7、before->front=new_node;new_node->back=before;before=new_node;}}printf("Successtocreate");getchar();system("clear");returnhead->front;}DoubleLinkaddnode(DoubleLinkL){DoubleLinkaddnew,end;end=L;addnew=(DoubleLi