请问怎么把输入的字符串保存在字符数组中阿?
像这样:我用scanf输入:********
hello, olleh why?(注意有空白间隔)
*****************
好像用scanf,如果碰到回车或空白就停止读取用户的输入了?输出效果是
***hello,***
而非
****hello, olleh why?。***
求点明!感谢
求点明!感谢
2011-05-15 21:39

2011-05-15 22:33
2011-05-16 10:24
程序代码:#include <stdio.h>
int main(int argc, char *argv[])
{
char s[10],t[10]={' '},v[10]={' '};
scanf("%s %s %s",s, t+1, v+1);
printf("%s",strcat(s,strcat(t,v)));
return 0;
}

2011-05-16 10:56