#include<iostream>
using namespace std;
int main()
{
void copy(char*q1,char*q2,int n);
char str1[10],str2[10];
int m;
cin>>str1>>m;
copy(str1,str2,m);
cout<<"str2:"<<str2;
return 0;
}
void copy(char*q1,char*q2,int m)
{
int i=m;
while(*(q1+i-1))
{*(q2+i-m)=*(q1+i-1);
i++;
}
*(q2+i-m)=0;
}
急求!
编译时出现错误could not deduce template argument for ''from'void'
不是这个问题,compile的时候是说could not deduce template argument for ''from'void'
追答就是你声明的位置错了。
追问还真是,多谢啦~可为啥以前我都把函数声明写在main函数里都没错为啥这次就不行啊。。。