我正在使用命令行界面編寫一個小程序。在這個程序中,我想擁有一個我設法創建的搜索功能。如何在此C++程序中創建搜索功能
但是,它的字符搜索的名字,但我想創建相同的功能,將能夠使用「學生註冊號碼」進行搜索。
在那裏我遇到了問題搜索案例:
int kWord;
stdDetails stdFind;
cout<<"Enter the Student Registration Number of the Student: ";
cin>>kWord;
for(int x=0;x<i;x++){
stdFind = stdDetailsStructs_0[x];
if(!strcmp(kWord,stdFind.stdNum)){
search=1;
break;
}
}
if(search==1){
display(stdFind);
}else{
cout<<"Student details not found please try again."<<endl;
}
這是一個很大的代碼要經過.. – JBL
即使你設置了5000的賞金,我也不會讀那個代碼。順便說一句,嘗試使用STL。它可能會幫助你。 – user1764961
好吧我只是編輯它,並把搜索部分只有 –