Heyz all.Im working on a program to add,sort,search etc contact struct (name last name number..).So i add structs and i sort them with qsort (i print the result,they are sorted).I have problem using bsearch(),it keeps returning NULL (so i see printed "not found"). The error must be something with the pointers key1,key2 etc.Any help is welcome.
char *key1,**key2;
char key[20];
else if (choice==3) {
printf("\n\nEnter a search key: ");
///gets(key);
///printf("%s",key);
scanf("%s%*c",key);
key1=key;
key2=&key1;
key1= bsearch(key2,catalogue,catFreeEntry,sizeof(struct catPage), pt1);
if (key1==NULL) { printf("\n not found");}
else {
printf("%s found",key);
}
}