请教char[]和char*的细微差别
#include <iostream>
using namespace std;
char *mystrcpy(char *destination, const char *source)
{
while(*destination++=*source++);
return (destination-1);
}
int main()
{
char c[]="wawa"; //如果换成char c*="wawa"就运行出错,编译没问题 有什么区别嘛?
char d[]="lala"; //如果一定要用char*改怎么改呢
mystrcpy(c,d); //而且函数的返回值申明的也是char*啊
cout<<c;
return 0;
}