Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include "dictionary.h"
  2. char *find(const struct dictionary *dict, const char *key)
  3. {
  4. if (key == NULL || dict == NULL)
  5. return NULL;
  6. for (int i = 0; i < dict->size; i++)
  7. {
  8. if (strcmp(dict->data[i].key, key)==0)
  9. return dict->data[i].value;
  10. }
  11. return NULL;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement