[求助]那位大虾帮我瞧瞧,我看了半天看不懂
#include <stdio.h> #include <stdlib.h>
main() { char *str; char *p; str = (char *)malloc(100); p=str; while( *str++ = getchar() != '\n' ); *(str-1) = '\0'; printf("%s",p); getchar(); } 输入how are you!回车 为什么输出的却不是how are you!
[此贴子已经被作者于2005-10-19 22:42:47编辑过]