#include <stdio.h>
void insert(char *s, char *t, int pos)
{
char *p,*q= t,*r;
p = s + pos;
while (*q!='\0')
{
q++;
}
while (*p!='\0')
{
*q=*p;
q++;
p++;
}
p = s + pos;
while (*t != '\0')
{
*(p++) = *(t++);
}
puts(s);
}
void insertss(char *s, char *t, int pos)
{
char *p ,r[5];
int i = 0, lent = 0;
p = s + pos;
while (*p != '\0')
{
r[i++]= *p++;
}
r[i]='\0';
p = s + pos;
while (*t != '\0')
{
*(p++) = *(t++);
lent++;
}
i=0;
p=s+pos+lent;
while (r[i] != '\0')
{
*(p++) = r[i++];
}
puts(s);
}
int main(int argc, char const *argv[])
{
char s[20] = "adbdsd";
char t[10] = "a34";
int pos = 4;
insert(s, t, pos);
return 0;
}