Skip to content
Snippets Groups Projects
Verified Commit b73be2bf authored by orestis.malaspin's avatar orestis.malaspin
Browse files

added code

parent 2c03f8ba
Branches
No related tags found
No related merge requests found
#include <stdio.h>
struct key_t {
int k;
};
struct value_t {
int v;
};
struct key_value_t {
struct key_t key;
struct value_t value;
};
struct elem {
struct key_value_t kv;
struct elem *next;
};
struct table {
struct elem *head;
};
struct value_t *sequential(struct table tab, struct key_t key) {
struct elem *e = tab.head;
while (e != NULL) {
if (e->kv.key.k == key.k) {
return &(e->kv.value);
}
e = e->next;
}
return NULL;
}
int main() {
int w = 5;
/*int *v = NULL;*/
int *v = &w;
printf("%d\n", *v);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment