我试图理解以下代码,但我在"\0"
和之间感到困惑'\0'
。我知道它很愚蠢但请帮助我
#define MAX_HISTORY 20
char *pStr = "\0";
for(x=0;x<MAX_HISTORY;x++){
str_temp = (char *)malloc((strlen(pStr)+1)*sizeof(char));
if (str_temp=='\0'){
return 1;
}
memset(str_temp, '\0', strlen(pStr) );
strcpy(str_temp, pStr);