title: Replace a character in a string with another string without using built in functions
body: <p>I have two strings. <code>s={"Mangalore"}</code> and <code>p={"Man"}</code>. Iwant to replace every occurance of <code>'a'</code> with string <code>"man"</code>. i.e. 
  input: Mangalore
  output: MManngManlore
  I tried this program. But I'm stuck at one point. Here my <em>function</em>:</p>
  
  <pre><code>string_replace(char *s,char *p)
  {
   char t[25];
   int i,j,len1,len2;
   len1=strlen(s);
   len2=strlen(p);
   for(i=0;i&lt;len1;i++)
   {
    if(s[i]=='a')
     {
       for(j=0;j&lt;len2;j++)
         t[i+j]=p[j];
      }
      else
       {
        t[i]=s[i];
       }
    }
  }
  </code></pre>
  
  <p>My doubt is in the statement <code>t[i]=s[i];</code>. What i need to write in place of this. Please help me. I need to write it without using built in functions.</p>
  
  <p>Thanks in Advance.. </p>