指针问题!!
#include<stdio.h>main()
{
char *ch1[4]={"hello","ni","hao","a"};
char *ch2[4]={"fei","chang","gao","xin"};
char **p1=NULL;
*p1=ch1[1];
printf("%s\n",*p1);
}
编译时没有错,但是运行错误。
把代码该成
#include<stdio.h>
main()
{
char *ch1[4]={"hello","ni","hao","a"};
char *ch2[4]={"fei","chang","gao","xin"};
char **p1=ch2;
*p1=ch1[1];
printf("%s\n",*p1);
}
运行后又对了,是怎么回事啊。
为什么不能给**P1赋空值啊
[ 本帖最后由 ycd123 于 2010-3-31 11:58 编辑 ]