while(!isalpha(string1[index])) ++index;当为?号时,这个循环会执行,使index超过边界,所以或出现乱码。while(string1[index]!='\0')即这个循环要到10000=index使才结束,而不是string1的末尾。