<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>一花一世界 &#187; Programming</title>
	<atom:link href="http://www.juliuschen.com/archives/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.juliuschen.com</link>
	<description>谈笑间，樯橹灰飞烟灭</description>
	<lastBuildDate>Sun, 29 Aug 2010 10:32:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>C语言文件操作</title>
		<link>http://www.juliuschen.com/archives/22.html</link>
		<comments>http://www.juliuschen.com/archives/22.html#comments</comments>
		<pubDate>Sun, 15 Aug 2010 13:53:24 +0000</pubDate>
		<dc:creator>Julius Chen</dc:creator>
				<category><![CDATA[Files]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C语言文件操作]]></category>
		<category><![CDATA[文件操作函数]]></category>
		<category><![CDATA[文件流]]></category>

		<guid isPermaLink="false">http://www.juliuschen.com/?p=22</guid>
		<description><![CDATA[在C语言中，对文件的操作都通过标准库中的函数或宏来进行。标准库不是C语言本身的构成部分，但是支持标准C的实现都会提供该函数库中的函数声明、类型以及宏定义。比如，与文件操作相关的函数都定义在输入输出头文件&#60;stdio.h&#62;中。 流、缓存和文件 流（stream）不是缓存，也不等于文件。流是一种逻辑的、与设备无关的操纵多种外设方式，它把数据输入输出的操作对象（如磁盘文件或是物理设备的打印机、显示器、键盘等）都抽象化为一种“流”而不管其具体结构，这样涉及到流的操作函数都可用于各种对象，提高了编程的通用性。《C程序设计语言》中说“流是与磁盘或其他外围设备关联的数据的源或目的地，打开一个流，将把该流与一个文件或设备连接起来，关闭流将断开这种连接”。从代码的实现上来看，一个流可以由一个FILE结构来描述，而FILE结构里包含了指向缓冲区的指针和文件描述符，打开一个流时它通过指向缓冲区的指针和文件描述符来和缓存与文件（或设备）关联。更多的介绍还可以看这里和这里。 文件操作函数 FILE *fopen(const char *filename, const char *mode) fopen函数打开filename指定的文件，并返回一个与之相关联的流。如果打开操作失败，则返回NULL。 int fclose(FILE *stream) fclose函数将所有未写入的数据写入stream中，丢弃缓冲区中的所有未读输入数据，并释放自动分配的全部缓冲区，最后关闭流。若出错则返回EOF，否则返回0。 int remove(const char *filename) remove函数删除filename指定的文件，这样，后续试图打开该文件的操作将失败。如果删除操作失败，则返回一个非0值。 int rename(const char *oldname, const char *newname) rename函数修改文件的名字。如果操作失败，则返回一个非0值。 int setvbuf(FILE *stream, char *buf, int mode, size_t size) void setbuf(FILE *stream, char *buf) setvbuf/setbuf函数控制流stream的缓冲。 格式化输入/输出 int fprintf(FILE *stream, const char *format, &#8230;) fprintf函数按照format说明的格式对输出进行转换，并写到stream流中。返回值是实际写入的字符数。若出错则返回一个负值。 int fscanf(FILE [...]]]></description>
		<wfw:commentRss>http://www.juliuschen.com/archives/22.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>字符串函数</title>
		<link>http://www.juliuschen.com/archives/18.html</link>
		<comments>http://www.juliuschen.com/archives/18.html#comments</comments>
		<pubDate>Sat, 16 Jan 2010 08:19:14 +0000</pubDate>
		<dc:creator>Julius Chen</dc:creator>
				<category><![CDATA[String]]></category>
		<category><![CDATA[字符串函数]]></category>

		<guid isPermaLink="false">http://www.juliuschen.com/archives/18</guid>
		<description><![CDATA[几个常见字符串处理函数 /* * * str开头的函数部分 * In the following functions, variables s and t are of type char *; * cs and ct are of type const char *; n is of type size_t; * and c is an int converted to char. */ &#160; // strcpy - copy string ct to string s, including [...]]]></description>
		<wfw:commentRss>http://www.juliuschen.com/archives/18.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
