From 16c2c412f3062924ad7869068730b2c56afbcff8 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Mon, 1 May 2023 22:12:45 +0530 Subject: 6.1.1: 6.1 but with pointers instead of array indices --- 6.1.1/key.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 6.1.1/key.h (limited to '6.1.1/key.h') diff --git a/6.1.1/key.h b/6.1.1/key.h new file mode 100644 index 0000000..1b46587 --- /dev/null +++ b/6.1.1/key.h @@ -0,0 +1,13 @@ +#ifndef KEY_H + +#define NKEYS (sizeof(keytab) / sizeof(keytab[0])) + +struct key { + const char *word; + int count; +}; + +#define KEY_H +#endif + +struct key *bsearch(char *word, struct key tab[], int n); -- cgit v1.2.3