标签:highlight new access key word div 复制 void TE
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++; } return str; } void main(int argc, char *argv[]) { char *a = new char[10]; strcpy(a, "abcdcccd" ); cout << f(a, ‘c‘ ); } |
abdcccd
abdd
abcc
abddcccd
Access Violation
答案D 错选B
标签:highlight new access key word div 复制 void TE
原文地址:https://www.cnblogs.com/kxzh/p/9126398.html