Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ switch string

switch(str2int("my string"))
{
  case str2int("my string")):
    {
    }
    break;
}

constexpr unsigned int str2int(const char* str, int h = 0)
{
    return !str[h] ? 5381 : (str2int(str, h+1) * 33) ^ str[h];
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #switch #string
ADD COMMENT
Topic
Name
1+3 =