当使用malloc提示找不到标识符时?
解决方法:加上 #include "malloc.h"
错误 1 error C3861: “malloc”: 找不到标识符
#include<stdio.h>
//#include "malloc.h"
#define NULL 0
void copy_string(char **p,int num)
{
*p=(char*)malloc(num);
}
int main(void)
{
char *str=null;
copy_string(&str,100);
strcpy(str,"hello");
while(1);
return 0;
}