/****************************************** !* Searching functions for list of names * !* to be used by program Search.cpp. * !*****************************************/ #include #include typedef char Str20[21]; //Names of length 20 Str20 a[100], target; //index 0 is used here void FindFirst(int size, int *where) { // Linear search of a list of names for first occurence // of target value. int iwh; iwh=0; while (strcmp(a[iwh],target)!=0 && iwh < size) iwh++; if (strcmp(a[iwh],target)!=0) iwh=-1; *where = iwh+1; } void FindAll(int size, int *how_many) { // Linear search of a list of names for all occurences // of target value. int hmn, i; hmn=0; for (i=0; i 0) hi=mid-1; else lo=mid+1; } *where = iwh+1; } // end of file fsearch.cpp