Thank you for teaching so patient, we learn a lot from it!
2016-06-17
#include<iostream>
using namespace std;
int main()
{
char *str = new char[100];
strcpy(str, "Hello world.");
cout<<str<<endl;
delete []str;
str = NULL;
return 0;
}
using namespace std;
int main()
{
char *str = new char[100];
strcpy(str, "Hello world.");
cout<<str<<endl;
delete []str;
str = NULL;
return 0;
}
最赞回答 / 稚嫩的魔法师
const 固定的是*p,指针p指向的变量x内存空间存放的值不能通过(*p)赋值某个数来改变,但是指针p本身是不受限制的,可以将变量y的地址赋值给p;将y的地址赋值给p后,也无法通过对(*p)的赋值操作来改变y的值.
2016-06-16