help in inserting a word in a string at position specified
<p>I made a code that would insert a word entered by the user in a string at specified position.for example if string is :alice wonderland,word is in and pos is 6,op/ should be:   alicein wonderland 
But,the code isn't working.Can u tell me the flaws?
here's the code:</p>

<pre><code>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;
#include&lt;stdio.h&gt;
void main()
{
    char str[100],word[50];
    int i,len,p,f,w;
    clrscr();
    cout&lt;&lt;"Enter string"&lt;&lt;endl;
    gets(str);
    cout&lt;&lt;"Enter word and position"&lt;&lt;endl;
    gets(word);
    cin&gt;&gt;p;
    for(len=0;str[len!='\0';len++);
    for(w=0;word[w]!='\0';w++);
    for(i=len-1;i&gt;=p-1;i--)
       str[i+w]=str[i];
    for(i=p-1;f=0;f&lt;w;f++,i++)
       str[i]=word[f];
    str[len+w-1]='\0';
    cout&lt;&lt;"Modified string..."&lt;&lt;endl;
    puts(str);
    getch();
}
</code></pre>
