| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | char* f(char *str, char ch) {    char *it1 = str;    char *it2 = str;    while(*it2 != ‘\0‘) {        while(*it2 == ch) { it2++; }        *it1++ = *it2++;     }    returnstr;}void main(int argc, char *argv[]) {    char *a = newchar[10];    strcpy(a, "abcdcccd");    cout << f(a, ‘c‘);} | 
abdcccd
abdd
abcc
abddcccd
Access Violation
答案D 错选B
原文:https://www.cnblogs.com/kxzh/p/9126398.html