Answers for "c++ switch string"

C++
0

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];
}
Posted by: Guest on December-03-2020
0

c++ switch case

switch(expr) {
  case 1:
    // do something
    break;
  case 2:
    // do something
    break;
  default:
    // do something
}
Posted by: Guest on January-03-2021

Browse Popular Code Answers by Language