作者ssagit (ssagit)
看板Programming
标题Re: 关於gets(const char *)的用法?
时间Sun Sep 10 01:53:06 2006
※ 引述《jtmh (Believing is seeing! ^^)》之铭言:
: ※ 引述《[email protected] (Pooh)》之铭言:
: : scanf的话不可以以string的格式读取一整行(包括空隔)?
: 原则上不行。
也不是不行, Try:
char s[100];
scanf("%[^\n]", s);
printf("%s\n", s);
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 211.74.191.133