title: C Pointers Problem Concatenating Strings
body: <p>I am going through some exercises and am trying to concatenate two strings using only pointers (no char arrays).
  My code seems to compile(Note: I am using the old 16-bit Open Watcom compiler):</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(){
    char *str1 = "first";
    char *str2 =" second";
  
    strcat2(str1,str2);
  
    for(;*str1!='\0';str1++){
        printf(str1);
    }
  
    return 0;
  }
  
  int strcat2(char *s,char *t){
    for(;*s!='\0';s++){
      ;
    }
  
    while((*s++ = *t++)!='\0'){
      ;
    }
  
    *t++;
    t='\0';
  
    return 0;
  }
  </code></pre>
  
  <p>When I tried to run it nothing happens.
  I am sure my above work is horribly flawed. Any advice and help will be much appreciated.</p>