为什么这是对的?
#include<iostream>
using namespace std;
int main()
{
char *s="raman";
char *t="rawan";
s=t;
cout<<s;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
但这是错的?
#include<iostream>
using namespace std;
int main()
{
char s[]="raman";
char t[]="rawan";
s=t;
cout<<s;
return 0;
}
Run Code Online (Sandbox Code Playgroud) c++ ×1