C中如何在字符串确定的地方接入一段新的字符串

比如,字符串ch[10]中abcdefg
想在a[2]之后插入str[]=“llllll”的字符,
所得结果a[]为abcllllll

试试:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
    char ch[10] = "abcdefg";
    char str[] = "llllll";
    char a[100];
    strcpy(a, ch);
    strcpy(&a[2+1], str);
    printf("%s\n\n",a);
    system("pause");
    return 0;
}

参考——http://blog.csdn.net/u012421456/article/details/38645335

用a[2]的指针去接受字符就好了,a[2]的指针应该就是a+2。