title: How to convert pid_t to string
body: <p>So, I need to strcat pid to some string. 
  I have this</p>
  
  <pre><code>strcat (str,(char*)getpid());
  </code></pre>
  
  <p>but this doesn't work.</p>
  
  <p>----edit----</p>
  
  <p>ok i understand the downvotes. i was too quick to post a question. and didnt realize pid returns an int and i can't cast an int to char*</p>
  
  <p>itoa doesnt work because it is not standart c.</p>
  
  <p>this is how i did it.</p>
  
  <pre><code>char pid[10];
  snprintf(pid, 10,"%d",(int)getpid());
  strcat (str, pid); 
  </code></pre>