- 论坛徽章:
- 2
|
a['A'] is equal to a[65], use it at your own risk.
Using C means do it yourself. Anything is possible.
An Example:
struct array_entity_s {
char key_name[MAX_KEY_NAME];
void *data;
struct array_entity_s *next;
};
void *f_get_array_entity(const struct array_entity_s *array, const char *name) {
for (; array->data != NULL; array++) {
if (strcmp(array->key_name, name) == 0) {
return array->data; /* found array entity*/
}
}
return NULL; /* not found */
}
int f_append_array_entity(...){...}
int f_delete_array_entity(...){...} |
|