struct in C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct my_struct lookup(int count, const struct my_struct coll[], char value[]) { | |
int i; | |
for (i = 0; i < count; ++i) { | |
if (strcmp(coll[i].attr, value) == 0) { | |
return coll[i]; | |
} | |
} | |
return NULL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment