Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
struct in C
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