title: Cast char to char array or char array to char?
body: <p>So let's say I have a char and I want to strcat() it to a char array in a single line of code. For [a non-practical] example:</p>
  
  <pre><code>strcat("ljsdflusdfg",getchar());
  </code></pre>
  
  <p>Or I wanted to do the reverse, what would be the appropriate function to concat or typecast strings, regardless of data type? Or perhaps there is some syntax I'm missing...</p>
  
  <p>Here's an example. It compiles just fine but crashes.</p>
  
  <pre><code>char* input(){
   char* inp="";
   while(1){
    char c=getchar();
    if(c){
     if(c=='\n'||c==EOF){
      break;
     }else{
      strcat(inp,(char*)c);
     }
    }
   }
   return inp;
  }
  </code></pre>