home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------*/
- /* ╡{ªí└╔ªW║┘: wat105.c */
- /*------------------------------------------------------------------*/
- #include <stdio.h>
- #include <stdlib.h>
-
- int compare(int *a, int *b)
- {
- return( *a - *b );
- }
-
- void main()
- {
- int mynumber[5] = {135, 27, 14, 234, 65};
- unsigned num = 5;
- int key;
- int *result;
-
- key = 14;
- result = lfind(&key, mynumber, &num,
- sizeof(int), (int(*)(const void *,const void *))compare);
- if (result)
- printf("ºΣ¿∞╝╞ªr %d ñF\n",key);
- else
- printf("ºΣñú¿∞╝╞ªr %d \n",key);
- }