In my other subroutine, I am inputting a person's first and last name. Here, I am merely searching for the last name. Whenever I input Snum that is supposed to be someone's last name, it gives me the "This person does not have this last name."
I have tried re-editing and fixing, but to no prevail, can anyone tell me what the problem is?
Code:void searchlast() { int I, found,f; char Snum[25][25]; clrscr(); do{ cout<<"Last Name You Are Searching For: "; cin>>Snum[I]; found=0; for(I=1; I<=u; I++) { if(namel[I]==Snum[I]) { cout<<"The Last Name " <<Snum<<" Was Found "; cout<<"In: "; cout<<""<<namef[I]; cout<<" "<<namel[I];cout<<"\n"; cout<<"This person has an Average Score of: "<<avg[I];cout<<"\n"; found=1; } if(namel[I]!=Snum[I]) { cout<<"No Student has this Last Name. \n"; } } cout<<"Search a new #? 1=Yes | 2=No: "; cin>>f; clrscr(); }while(f!=2);



LinkBack URL
About LinkBacks



