这个小程序有什么有关问题请大家说一下
这个小程序有什么问题请大家说一下
#include "stdio.h "
#include "string.h "
void main()
{
char *pstrar[3];
strcpy(pstrar[0], "世界 ");
printf( "%s\n ",pstrar[0]);
}
------解决方案--------------------
char*,内存还没申请就直接strcpy
#include "stdio.h "
#include "string.h "
void main()
{
char *pstrar[3];
strcpy(pstrar[0], "世界 ");
printf( "%s\n ",pstrar[0]);
}
------解决方案--------------------
char*,内存还没申请就直接strcpy