函数的执行
#include "stdio.h"
#include "string.h"
#include "windows.h"
void GetMemory(char *cpStr)
{
cpStr = new char[100];
return;
}
void Test(void)
{
char *cp_str = NULL;
GetMemory(cp_str);
strcpy(cp_str,"Hello,world!");
printf(cp_str);
return;
}
void main()
{
Test();
}
请问程序会发生什么情况?以及详细解释产生此种情况的原因?