title: How to cast char to string in C?
body: <p>Im new to C and i encounter a problem with using strcat(). I looked up strcat and noticed that it takes string as arguments but when i split items from a char array is a char and when i use it as a argument for strcat it prints out error.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  int main()
  {   
  char a[10]="abcdefg123";
  char *pa=a;
  char *out[2]={"",""};
  int counter=0;
  while(*pa != '\0'){
      if (counter%2==0){
          strcat(out[0],*pa);
      }
      else{
      strcat(out[1],*pa);
      }
  
      counter++;
      pa++;    
     } 
  printf("%s,%s\n",out[0],out[1]);
  
  return 0;
  }
  </code></pre>
  
  <p>the purpose of the code is to split a string into two string that each contain all the characters in odd position or even position.However, when im tring to dereference the char pointer all i get is a Char but it seems i need string</p>