char st[20],*ps;
int i;
printf("input a string:\n");
ps=st;
scanf("%s",ps);
这样的话输入的值被存到 st 里面了
char st[20],*ps;
int i;
printf("input a string:\n");
ps=st;
ps="hello";
这样st里面没有值
求解答 谢谢
...全文
5325打赏收藏
指针指向字符串然后给指针赋值
char st[20],*ps; int i; printf("input a string:\n"); ps=st; scanf("%s",ps); 这样的话输入的值被存到 st 里面了 char st[20],*ps; int i; printf("input a string:\n"); ps=st; ps="hello"; 这样st里面没有值 求解答 谢谢