viewing paste Unknown #17303 | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
enum cydh_failed {
  CYDH_R  = 10,
  CYDH_R_ = 20,
}
 
const char* ConvertToString(cydh_failed c)
{
  switch(c)
  {
    case CYDH_R : return "CYDH_R";
    case CYDH_R_: return "CYDH_R_";
  }
  return "";
}
 
void some_function(){
  enum cydh_failed a = 10;
  printf("%s\n", ConvertToString(a));   //Should Return "CYDH_R"
}
Viewed 262 times, submitted by unknown.