2014-05-04から1日間の記事一覧
C言語でバイナリサーチをするサンプルです。 < #include #include #include static int cmp(const void *p1, const void *p2) { char *c1; char *c2; c1 = *(char **)p1; c2 = *(char **)p2; //printf("cmp %s - %s\n", c1, c2); return strcmp(c1, c2); } …
C言語でバイナリサーチをするサンプルです。 < #include #include #include static int cmp(const void *p1, const void *p2) { char *c1; char *c2; c1 = *(char **)p1; c2 = *(char **)p2; //printf("cmp %s - %s\n", c1, c2); return strcmp(c1, c2); } …