Question #275171

In a college the faculty member wants find a student with help of their register number, now he wants to compare the register no. one by one and to find the corresponding person. Use the suitable searching technique.

Expert's answer

string *students;

int find(string name){
  int idx=-1;
  for(int i=0;i<sizeof(students)/sizeof(students[0]);i++)
    if(name==students[i]) idx=i;
  return idx;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS