<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[fgets问题]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Fri, 16 Nov 2007 05:29:49 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	fgets问题<br/> <br/>fgets（由文件中读取一字符串） <br/><br/>相关函数 <br/>open，fread，fscanf，getc<br/><br/>表头文件 <br/>include<stdio.h><br/><br/>定义函数 <br/>har * fgets(char * s,int size,FILE * stream);<br/><br/>函数说明 <br/>fgets()用来从参数stream所指的文件内读入字符并存到参数s所指的内存空间，直到出现换行字符、读到文件尾或是已读了size-1个字符为止，最后会加上NULL作为字符串结束。<br/><br/>返回值 <br/>gets()若成功则返回s指针，返回NULL则表示有错误发生。<br/><br/>范例 <br/>#include<stdio.h><br/>main()<br/>&#123;<br/>char s[80];<br/>fputs(fgets(s,80,stdin),stdout);<br/>&#125;<br/><br/>执行 <br/>this is a test /*输入*/<br/>this is a test /*输出*/<br/><br/>这里是函数的说明<br/><br/><br/>代码:<br/><br/>--------------------------------------------------------------------------------<br/><br/>typedef char (*ARRAYPTR)[10];<br/>typedef char ARRAY[10];<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br/>main(void)<br/>&#123;<br/> &nbsp;ARRAYPTR ap;<br/> &nbsp;ARRAY a;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br/> &nbsp;printf("Input a string : ");<br/> &nbsp;fgets(a,100,stdin);<br/> &nbsp;ap=&a;<br/> &nbsp;printf("&#92;nECHO : %s&#92;n",ap);<br/>&#125;<br/>100就是size，你上面已经写了。stdin是“标准输入”，一般指终端输入（键盘输入）。这一句的意思是从键盘输入一个字符串，这个字符串加上换行符不能超过100个字节,因此实际最多可以输入99个字符。<br/>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] fgets问题]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>