Possible Duplicate:
C/C++: switch for non-integers
Hi, I need to use a string in switch case. My solution so far was to calculate the hash of the string with my hash function. Problem is I have to manually pre-calculate all my hash values for strings. Is there a better approach?
h=_myhash (mystring);
switch (h)
{
case 66452:
.......
case 1342537:
........
}