title: trying to create a function in c that takes in user input and returns a string of char
body: <p>No matter what I try I get an error. I'll remove the pointer, remove the malloc, I've tried reading in the user input in dfferent ways. I come form a java background and very confused on why none of this is working. Also I am not trying to return an array of strings i am just trying to return a string or a single array of chars in c</p>
  
  <pre><code> main(){
          char *c = getResources();
   }
  
   char * getResources(){
         char *str = (char *) malloc(sizeof(char) * 3);
         fgets(str, sizeof(str), stdin);      /* read in a line */
         return *str;
   }
  </code></pre>