B
Bas Nedermeijer
Hello,
what is a efficient solution to compare a string against a lot of
possiblities?
Currently i am having a lot of
if (strcmp(checkme, "option1", strlen(checkme))) {
value = OPTION1;
}
is there an other option? Or can i (ab)use a map or something for this?
Only then i would have the problem of filling the map first on every
call (or use a global).
I am using the current setup to gather input from keyboard / remote and
network. So i can handle the commands on a central place.
Suggestions welcome
gr. Bas
what is a efficient solution to compare a string against a lot of
possiblities?
Currently i am having a lot of
if (strcmp(checkme, "option1", strlen(checkme))) {
value = OPTION1;
}
is there an other option? Or can i (ab)use a map or something for this?
Only then i would have the problem of filling the map first on every
call (or use a global).
I am using the current setup to gather input from keyboard / remote and
network. So i can handle the commands on a central place.
Suggestions welcome
gr. Bas