title: Create a function that takes in an enum variable and returns a string pointer
body: <p>I need to create a function that takes in an enum variable representing the day of the week as a parameter and returns a string pointer with the name of the day.</p>
  
  <p>This is my code:</p>
  
  <pre><code>char *week(enum DAY x);
  
  enum DAY {Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday};
  
  void main()
  {
  char *date;
  date = week(Monday);
  
  printf("%s",date);
  }
  
  
  char *week(enum DAY x) {
  
  char date[20];
  
  switch (x)
  {
  case Monday:
      strcpy(date,"Monday");
      break;
  case Tuesday:
      strcpy(date,"Tuesday");
      break;
  case Wednesday:
      strcpy(date,"Wednesday");
      break;
  case Thursday:
      strcpy(date,"Thursday");
      break;
  case Friday:
      strcpy(date,"Friday");
      break;
  case Saturday:
      strcpy(date,"Friday");
      break;
  case Sunday:
      strcpy(date,"Friday");
      break;
  }
  return date;
  }
  </code></pre>
  
  <p>When I run it,the console prints symbols. Assistance much appreciated.</p>
  
  <p>Also, is it possible to have an enum variable as a user input instead of directly through the compiler ?</p>