What is the best way to do a "switch" equivelant for a string.
I have been using
if ( strncmp( string1, string2, s ) == 0 )
else if ( strncmp( string1, string3, s ) == 0 )
else if ( strncmp( string1, string4, s ) == 0 )
etc
Is there a more efficient way of doing this?