各位大侠帮忙看看代码!!万分感谢!!!
#include<iostream>#include<string>
#include<malloc.h>
void GetMemory(char*p)
{
p = (char*) malloc(100);
}
int main()
{
using namespace std;
char *str = NULL ;
GetMemory(str);
strcpy(str,"Thunder");
strcat(str+2,"Downloader");
cout<<str<<endl;
return 0;
}
这个代码是不是会崩溃??解释解释啊!!