error C2664: “strcmp”: 不能将参数 1 从“char”转换为“const char *”
#include"stdafx.h"#include<iostream>usingnamespacestd;intstrcpyF(char*a1,char*a2){int...
#include "stdafx.h"
#include <iostream>
using namespace std;
int strcpyF(char * a1,char * a2){
int length = strlen(a1);
for(int i = 0 ; i <length ;i++){
if( strcmp(a1[i],"a") != 0 ){ //错误处
cout << a1[i];
}
}
return length;
}
int _tmain(int argc, _TCHAR* argv[])
{
strcpyF("abcfe","456");
return 0;
} 展开
#include <iostream>
using namespace std;
int strcpyF(char * a1,char * a2){
int length = strlen(a1);
for(int i = 0 ; i <length ;i++){
if( strcmp(a1[i],"a") != 0 ){ //错误处
cout << a1[i];
}
}
return length;
}
int _tmain(int argc, _TCHAR* argv[])
{
strcpyF("abcfe","456");
return 0;
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询