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

📄 node73.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>E/S formatt閑s sur fichiers</TITLE>
<META NAME="description" CONTENT="E/S formatt閑s sur fichiers">
<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="node74.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node74.htm">
<LINK REL="previous" HREF="node72.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.htm">
<LINK REL="up" HREF="node68.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node68.htm">
<LINK REL="next" HREF="node74.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node74.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="tex2html2251"
 HREF="node74.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node74.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="tex2html2247"
 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="tex2html2241"
 HREF="node72.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.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="tex2html2249"
 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="tex2html2250"
 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="tex2html2252"
 HREF="node74.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node74.htm">R閏r閍tion</A>
<B> D閎ut:</B> <A NAME="tex2html2248"
 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="tex2html2242"
 HREF="node72.htm" tppabs="http://www.linux-kheops.com/doc/ansi-c/node72.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="tex2html2253"
 HREF="node73.htm#SECTION00751000000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00751000000000000000">
Ecriture formatt閑&nbsp;: <TT>fprintf</TT></A>
<UL>
<LI><A NAME="tex2html2254"
 HREF="node73.htm#SECTION00751100000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00751100000000000000">
Utilisation</A>
<LI><A NAME="tex2html2255"
 HREF="node73.htm#SECTION00751200000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00751200000000000000">
S閙antique des param鑤res</A>
<LI><A NAME="tex2html2256"
 HREF="node73.htm#SECTION00751300000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00751300000000000000">
Valeur rendue</A>
<LI><A NAME="tex2html2257"
 HREF="node73.htm#SECTION00751400000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00751400000000000000">
Pr閟entation</A>
<LI><A NAME="tex2html2258"
 HREF="node73.htm#SECTION00751500000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00751500000000000000">
Les s閝uences d'閏happement</A>
</UL>
<LI><A NAME="tex2html2259"
 HREF="node73.htm#SECTION00752000000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00752000000000000000">
Ecriture formatt閑&nbsp;: <TT>printf</TT></A>
<UL>
<LI><A NAME="tex2html2260"
 HREF="node73.htm#SECTION00752100000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00752100000000000000">
Utilisation</A>
<LI><A NAME="tex2html2261"
 HREF="node73.htm#SECTION00752200000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00752200000000000000">
Description</A>
</UL>
<LI><A NAME="tex2html2262"
 HREF="node73.htm#SECTION00753000000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00753000000000000000">
Ecriture formatt閑 dans une cha頽e : <TT>sprintf</TT></A>
<UL>
<LI><A NAME="tex2html2263"
 HREF="node73.htm#SECTION00753100000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00753100000000000000">
Utilisation</A>
<LI><A NAME="tex2html2264"
 HREF="node73.htm#SECTION00753200000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00753200000000000000">
Description</A>
</UL>
<LI><A NAME="tex2html2265"
 HREF="node73.htm#SECTION00754000000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00754000000000000000">
Exemples d'utilisation des formats</A>
<LI><A NAME="tex2html2266"
 HREF="node73.htm#SECTION00755000000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00755000000000000000">
Entr閑s formatt閑s : <TT>fscanf</TT></A>
<UL>
<LI><A NAME="tex2html2267"
 HREF="node73.htm#SECTION00755100000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00755100000000000000">
Utilisation</A>
<LI><A NAME="tex2html2268"
 HREF="node73.htm#SECTION00755200000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00755200000000000000">
S閙antique des param鑤res</A>
<LI><A NAME="tex2html2269"
 HREF="node73.htm#SECTION00755300000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00755300000000000000">
Valeur rendue</A>
<LI><A NAME="tex2html2270"
 HREF="node73.htm#SECTION00755400000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00755400000000000000">
Description</A>
<LI><A NAME="tex2html2271"
 HREF="node73.htm#SECTION00755500000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00755500000000000000">
Quelques d閒initions</A>
<LI><A NAME="tex2html2272"
 HREF="node73.htm#SECTION00755600000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00755600000000000000">
Les s閝uences d'閏happement</A>
<LI><A NAME="tex2html2273"
 HREF="node73.htm#SECTION00755700000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00755700000000000000">
Algorithme de <TT>fscanf</TT></A>
<LI><A NAME="tex2html2274"
 HREF="node73.htm#SECTION00755800000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00755800000000000000">
Remarques sur la gestion des <I>espaces blancs</I></A>
</UL>
<LI><A NAME="tex2html2275"
 HREF="node73.htm#SECTION00756000000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00756000000000000000">
Entr閑s formatt閑s&nbsp;: <TT>scanf</TT></A>
<UL>
<LI><A NAME="tex2html2276"
 HREF="node73.htm#SECTION00756100000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00756100000000000000">
Utilisation</A>
<LI><A NAME="tex2html2277"
 HREF="node73.htm#SECTION00756200000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00756200000000000000">
Description</A>
</UL>
<LI><A NAME="tex2html2278"
 HREF="node73.htm#SECTION00757000000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00757000000000000000">
Entr閑s formatt閑s depuis une cha頽e : <TT>sscanf</TT></A>
<UL>
<LI><A NAME="tex2html2279"
 HREF="node73.htm#SECTION00757100000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00757100000000000000">
Utilisation</A>
<LI><A NAME="tex2html2280"
 HREF="node73.htm#SECTION00757200000000000000" tppabs="http://www.linux-kheops.com/doc/ansi-c/node73.htm#SECTION00757200000000000000">
Description</A>
</UL></UL>
<!--End of Table of Child-Links-->
<HR>
<H1><font COLOR=#1809BB><A NAME="SECTION00750000000000000000">
E/S formatt閑s sur fichiers</A>
</font></H1>
<P><H2><font COLOR=#1809BB><A NAME="SECTION00751000000000000000">
Ecriture formatt閑&nbsp;: <TT>fprintf</TT></A>
</font></H2>
<A NAME="3443">&#160;</A>
<P><H3><A NAME="SECTION00751100000000000000">
Utilisation</A>
</H3>
La fonction <TT>fprintf</TT> admet un nombre variable de param鑤res.
Son utilisation est la suivante&nbsp;:
<P><TT>fprintf</TT> <TT>(</TT> <I>flot-de-donn閑s</I> <TT>,</TT> <I>format</I> <TT>,</TT> <I>param<SUB>1</SUB></I> <TT>,</TT> <I>param<SUB>2</SUB></I> <TT>,</TT> ... <TT>,</TT> <I>param<SUB><I>n</I></SUB></I> <TT>)</TT>
<P><H3><A NAME="SECTION00751200000000000000">
S閙antique des param鑤res</A>
</H3>
<DL COMPACT>
<DT><SMALL>-</SMALL>
<DD><I>flot-de-donn閑s</I> est de type pointeur vers <TT>FILE</TT>.
Il pointe vers le fichier sur lequel se fait l'閏riture.
<DT><SMALL>-</SMALL>
<DD><I>format</I> est une cha頽e de caract鑢es qui sp閏ifie ce qui doit 阾re 閏rit.
<DT><SMALL>-</SMALL>
<DD><I>param<SUB><I>i</I></SUB></I> est une expression d閘ivrant une valeur 

⌨️ 快捷键说明

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