下面代码为什么会提示冲突
int replace(char*str, char c1, char c2) {
int count = 0;
int i = 0;
while (*str != '\0') {
if (str[i] = c1){
str[i] = c2;
count++;
}
i++;
}
return count;
}
int main()
{
char A[5] = "abcd";
cout << "count:" << replace(A, 'a', 'f') << endl << "A" << A;
return 0;
}