⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node72.htm

📁 Tutorila for CPP, very good tutorial for CPP
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//FR">
<!--Converted with LaTeX2HTML 97.1 (release) (July 13th, 1997)
 by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippman, Marek Rouchal, Martin Wilck and others -->
<HTML><BLOCKQUOTE><img src="logo.gif" tppabs="http://www.linux-kheops.com/doc/ansi-c/icons.gif/logo.gif" ALIGN=right></A> 
<HEAD>
<TITLE>Lecture et 閏riture par lignes sur fichier</TITLE>
<META NAME="description" CONTENT="Lecture et 閏riture par lignes sur fichier">
<META NAME="keywords" CONTENT="Introduction_ANSI_C">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso_8859_1">
<LINK REL="STYLESHEET" HREF="Introduction_ANSI_C.css" tppabs="http://www.linux-kheops.com/doc/ansi-c/Introduction_ANSI_C.css">
<LINK REL="next" HREF="node73.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm">
<LINK REL="previous" HREF="node71.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node71.htm">
<LINK REL="up" HREF="node68.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node68.htm">
<LINK REL="next" HREF="node73.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm">
</HEAD>
<BODY BACKGROUND="marge.gif" tppabs="http://www.linux-kheops.com/doc/ansi-c/icons.gif/marge.gif" TEXT=#000000 LINK=#FF0000 VLINK=#1809BB >
<!--Navigation Panel-->
<A NAME="tex2html2217"
 HREF="node73.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm">
<IMG WIDTH="77" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
 SRC="next_motif.gif" tppabs="http://www.linux-kheops.com/doc/ansi-c/icons.gif/next_motif.gif"></A> 
<A NAME="tex2html2213"
 HREF="node68.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node68.htm">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
 SRC="up_motif.gif" tppabs="http://www.linux-kheops.com/doc/ansi-c/icons.gif/up_motif.gif"></A> 
<A NAME="tex2html2207"
 HREF="node71.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node71.htm">
<IMG WIDTH="96" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
 SRC="previous_motif.gif" tppabs="http://www.linux-kheops.com/doc/ansi-c/icons.gif/previous_motif.gif"></A> 
<A NAME="tex2html2215"
 HREF="node1.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node1.htm">
<IMG WIDTH="96" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
 SRC="contents_motif.gif" tppabs="http://www.linux-kheops.com/doc/ansi-c/icons.gif/contents_motif.gif"></A> 
<A NAME="tex2html2216"
 HREF="node174.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node174.htm">
<IMG WIDTH="59" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
 SRC="index_motif.gif" tppabs="http://www.linux-kheops.com/doc/ansi-c/icons.gif/index_motif.gif"></A> 
<BR>
<B> Suivant:</B> <A NAME="tex2html2218"
 HREF="node73.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm">E/S formatt閑s sur fichiers</A>
<B> D閎ut:</B> <A NAME="tex2html2214"
 HREF="node68.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node68.htm">Les entr閑s-sorties</A>
<B> Pr閏閐ent:</B> <A NAME="tex2html2208"
 HREF="node71.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node71.htm">Lecture et 閏riture par</A><HR>
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><strong>Paragraphes</strong></A>
<UL>
<LI><A NAME="tex2html2219"
 HREF="node72.htm#SECTION00741000000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00741000000000000000">
lecture par ligne : <TT>fgets</TT></A>
<UL>
<LI><A NAME="tex2html2220"
 HREF="node72.htm#SECTION00741100000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00741100000000000000">
Utilisation</A>
<LI><A NAME="tex2html2221"
 HREF="node72.htm#SECTION00741200000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00741200000000000000">
S閙antique des param鑤res</A>
<LI><A NAME="tex2html2222"
 HREF="node72.htm#SECTION00741300000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00741300000000000000">
Valeur rendue</A>
<LI><A NAME="tex2html2223"
 HREF="node72.htm#SECTION00741400000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00741400000000000000">
Description</A>
<LI><A NAME="tex2html2224"
 HREF="node72.htm#SECTION00741500000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00741500000000000000">
Utilisation typique</A>
</UL>
<LI><A NAME="tex2html2225"
 HREF="node72.htm#SECTION00742000000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00742000000000000000">
lecture par ligne : <TT>gets</TT></A>
<UL>
<LI><A NAME="tex2html2226"
 HREF="node72.htm#SECTION00742100000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00742100000000000000">
Utilisation</A>
<LI><A NAME="tex2html2227"
 HREF="node72.htm#SECTION00742200000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00742200000000000000">
S閙antique des param鑤res</A>
<LI><A NAME="tex2html2228"
 HREF="node72.htm#SECTION00742300000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00742300000000000000">
Valeur rendue</A>
<LI><A NAME="tex2html2229"
 HREF="node72.htm#SECTION00742400000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00742400000000000000">
Description</A>
</UL>
<LI><A NAME="tex2html2230"
 HREF="node72.htm#SECTION00743000000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00743000000000000000">
閏riture par cha頽e : <TT>fputs</TT></A>
<UL>
<LI><A NAME="tex2html2231"
 HREF="node72.htm#SECTION00743100000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00743100000000000000">
Utilisation</A>
<LI><A NAME="tex2html2232"
 HREF="node72.htm#SECTION00743200000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00743200000000000000">
S閙antique des param鑤res</A>
<LI><A NAME="tex2html2233"
 HREF="node72.htm#SECTION00743300000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00743300000000000000">
Valeur rendue</A>
<LI><A NAME="tex2html2234"
 HREF="node72.htm#SECTION00743400000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00743400000000000000">
Description</A>
<LI><A NAME="tex2html2235"
 HREF="node72.htm#SECTION00743500000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00743500000000000000">
Utilisation typique</A>
</UL>
<LI><A NAME="tex2html2236"
 HREF="node72.htm#SECTION00744000000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00744000000000000000">
閏riture par cha頽e : <TT>puts</TT></A>
<UL>
<LI><A NAME="tex2html2237"
 HREF="node72.htm#SECTION00744100000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00744100000000000000">
Utilisation</A>
<LI><A NAME="tex2html2238"
 HREF="node72.htm#SECTION00744200000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00744200000000000000">
S閙antique des param鑤res</A>
<LI><A NAME="tex2html2239"
 HREF="node72.htm#SECTION00744300000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00744300000000000000">
Valeur rendue</A>
<LI><A NAME="tex2html2240"
 HREF="node72.htm#SECTION00744400000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm#SECTION00744400000000000000">
Description</A>
</UL></UL>
<!--End of Table of Child-Links-->
<HR>
<H1><font COLOR=#1809BB><A NAME="SECTION00740000000000000000">
Lecture et 閏riture par lignes sur fichier</A>
</font></H1>
<P><H2><font COLOR=#1809BB><A NAME="SECTION00741000000000000000">
lecture par ligne : <TT>fgets</TT></A>
</font></H2>
<A NAME="3429">&#160;</A>
<P><H3><A NAME="SECTION00741100000000000000">
Utilisation</A>
</H3>
 <TT>fgets (</TT><I>cha頽e</I><code> , </code><I>taille</I><code> , </code><I>flot-de-donn閑s</I><TT>)</TT>
<BR>
<P><H3><A NAME="SECTION00741200000000000000">
S閙antique des param鑤res</A>
</H3>
<DL COMPACT>
<DT><SMALL>-</SMALL>
<DD><I>cha頽e</I> est de type pointeur vers <TT>char</TT> et doit pointer vers un
tableau de caract鑢es.
<DT><SMALL>-</SMALL>
<DD><I>taille</I> est la taille en octets du tableau de caract鑢es point

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -