title: How to convert an enum type variable to a string?
body: <p>How to make printf to show the values of variables which are of an enum type? For instance:</p>
  
  <pre><code>typedef enum {Linux, Apple, Windows} OS_type; 
  OS_type myOS = Linux;
  </code></pre>
  
  <p>and what I need is something like </p>
  
  <pre><code>printenum(OS_type, "My OS is %s", myOS);
  </code></pre>
  
  <p>which must show a string "Linux", not an integer.</p>
  
  <p>I suppose, first I have to create a value-indexed array of strings. But I don't know if that is the most beautiful way to do it. Is it possible at all?</p>