title: Easy way to use variables of enum types as string in C?
body: <p>Here's what I am trying to do:  </p>
  
  <pre><code>typedef enum { ONE, TWO, THREE } Numbers;
  </code></pre>
  
  <p>I am trying to write a function that would do a switch case similar to the following: </p>
  
  <pre><code>char num_str[10];
  int process_numbers_str(Numbers num) {
    switch(num) {
      case ONE:
      case TWO:
      case THREE:
      {
        strcpy(num_str, num); //some way to get the symbolic constant name in here?
      } break;
      default:
        return 0; //no match
    return 1;
  }
  </code></pre>
  
  <p>Instead of defining at every case, is there a way to set it using the enum variable like I am trying to do above?</p>