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