I keep getting an error on the lines with strcmp that passing argument 3 of binsearch makes pointer from integer without a cast.
How can I fix this?
Code:void binsearch(char *dictionary, int wordnum, char string[]) { //Establish low and high points int low = 0; int high = wordnum - 1; //Adjust midpoint as necessary while (low <= high) { int mid = (low + high)/2; if (strcmp(string, dictionary[mid])<0) high = mid - 1; else if (strcmp(string, dictionary[mid]) > 0) low = mid + 1; //Print out correct permutation matches else if (strcmp(string, dictionary[mid]) == 0){ fprintf(ofp, "A permutation of the current word that is valid is %s.\n", string); break; } }



1Likes
LinkBack URL
About LinkBacks



