码迷,mamicode.com
首页 > 其他好文 > 详细

fgets

时间:2014-09-26 21:41:08      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   ar   sp   div   c   log   

#include<stdio.h>
#include<string.h>
void main()
{char buf[256];
 fgets(buf,256,stdin);
 //buf[strlen(buf)-1]=‘\0‘;//减1不会换行;
 //buf[strlen(buf)]=‘\0‘;//此时会换行的
 printf("%s",buf);
}

 

fgets

标签:style   blog   color   io   ar   sp   div   c   log   

原文地址:http://www.cnblogs.com/leijiangtao/p/3995472.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!