Files
hustoj/web/cppreference-zh/chmhelp/cpp-io-ios_base-iostate.html
2025-08-01 12:57:54 +08:00

286 lines
33 KiB
HTML

<!DOCTYPE html>
<html lang="zh" dir="ltr" class="client-nojs" xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh">
<head><meta http-equiv="x-ua-compatible" content="ie=edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>std::ios_base::iostate</title>
<link rel="stylesheet" href="ext.css" />
<link rel="stylesheet" href="site_modules.css" />
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_io_ios_base_iostate skin-cppreference2 action-view cpp-navbar">
<div id="cpp-content-base">
<div id="content"><a id="top"></a>
<h1 id="firstHeading" class="firstHeading"><span style="font-size:0.7em; line-height:130%">std::ios_base::</span>iostate</h1>
<div id="bodyContent">
<div id="contentSub"><span class="subpages">&lt; <a href="cpp.html">cpp</a>&lrm; | <a href="cpp-io.html">io</a>&lrm; | <a href="cpp-io-ios_base.html">ios base</a></span></div>
<div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr" xml:lang="zh">
<table class="t-dcl-begin">
<tbody>
<tr class="t-dcl">
<td class="t-dcl-nopad">
<div><span class="mw-geshi cpp source-cpp"><span class="kw1">typedef</span> <span class="coMULTI">/*implementation defined*/</span> iostate<span class="sy4">;</span></span></div>
</td>
<td class="t-dcl-nopad"></td>
<td class="t-dcl-nopad"></td>
</tr>
<tr class="t-dcl">
<td class="t-dcl-nopad">
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">static</span> <span class="kw4">constexpr</span> iostate goodbit <span class="sy1">=</span> <span class="nu0">0</span><span class="sy4">;</span></span></div>
</td>
<td class="t-dcl-nopad"></td>
<td class="t-dcl-nopad"></td>
</tr>
<tr class="t-dcl">
<td class="t-dcl-nopad">
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">static</span> <span class="kw4">constexpr</span> iostate badbit <span class="sy1">=</span> <span class="coMULTI">/*implementation defined*/</span><br /></span>
<p><span class="kw4">static</span> <span class="kw4">constexpr</span> iostate failbit <span class="sy1">=</span> <span class="coMULTI">/*implementation defined*/</span><br /></p>
<span class="kw4">static</span> <span class="kw4">constexpr</span> iostate eofbit <span class="sy1">=</span> <span class="coMULTI">/*implementation defined*/</span></div>
</td>
<td class="t-dcl-nopad"></td>
<td class="t-dcl-nopad"></td>
</tr>
<tr class="t-dcl-sep">
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#25351;&#23450;&#27969;&#29366;&#24577;&#26631;&#24535;&#12290;&#23427;&#26159;<a href="cpp-named_req-BitmaskType.html"><span style="font-style:italic">&#20301;&#25513;&#30721;&#31867;&#22411;</span> <span style="font-family: Georgia, &#39;DejaVu Serif&#39;, serif; font-style:italic">(BitmaskType)</span></a> &#65292;&#23450;&#20041;&#19979;&#21015;&#24120;&#37327;&#65306;</p>
<table class="t-dsc-begin">
<tr class="t-dsc-hitem">
<td>&#24120;&#37327;</td>
<td>&#35299;&#37322;</td>
</tr>
<tr class="t-dsc">
<td><strong class="selflink"><tt>goodbit</tt></strong></td>
<td>&#26080;&#38169;&#35823;</td>
</tr>
<tr class="t-dsc">
<td><strong class="selflink"><tt>badbit</tt></strong></td>
<td>&#19981;&#21487;&#24674;&#22797;&#30340;&#27969;&#38169;&#35823;</td>
</tr>
<tr class="t-dsc">
<td><strong class="selflink"><tt>failbit</tt></strong></td>
<td>&#36755;&#20837;/&#36755;&#20986;&#25805;&#20316;&#22833;&#36133;&#65288;&#26684;&#24335;&#21270;&#25110;&#25552;&#21462;&#38169;&#35823;&#65289;</td>
</tr>
<tr class="t-dsc">
<td><strong class="selflink"><tt>eofbit</tt></strong></td>
<td>&#20851;&#32852;&#30340;&#36755;&#20986;&#24207;&#21015;&#24050;&#25269;&#36798;&#25991;&#20214;&#23614;</td>
</tr>
</table>
<h4><span class="mw-headline" id="eofbit">eofbit</span></h4>
<p>&#19979;&#21015;&#26631;&#20934;&#24211;&#20989;&#25968;&#35774;&#32622; eofbit &#65306;</p>
<ul>
<li>string &#36755;&#20837;&#20989;&#25968; <span class="t-lc"><a href="cpp-string-basic_string-getline.html">std::getline</a></span> &#65292;&#33509;&#23427;&#20197;&#25269;&#36798;&#27969;&#32467;&#23614;&#65292;&#32780;&#38750;&#25269;&#36798;&#25351;&#23450;&#30340;&#32456;&#27490;&#23383;&#31526;&#23436;&#25104;&#12290;</li>
<li><a href="cpp-io-basic_istream-operator_gtgt.html"><tt>basic_istream::operator&gt;&gt;</tt></a> &#30340;&#25968;&#20540;&#36755;&#20837;&#37325;&#36733;&#65292;&#33509;&#22312; <a href="cpp-locale-num_get-get.html"><tt>num_get::get</tt></a> &#22788;&#29702;&#30340;&#38454;&#27573; 2 &#65292;&#35835;&#21462;&#19979;&#20010;&#23383;&#31526;&#26102;&#36935;&#21040;&#27969;&#32467;&#23614;&#12290;&#21462;&#20915;&#20110;&#20998;&#26512;&#29366;&#24577;&#65292;&#21487;&#33021;&#25110;&#21487;&#33021;&#19981;&#21516;&#26102;&#35774;&#32622; <code>failbit</code> &#65306;&#20363;&#22914; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">int</span> n<span class="sy4">;</span> istringstream buf<span class="br0">(</span><span class="st0">&quot;1&quot;</span><span class="br0">)</span><span class="sy4">;</span> buf <span class="sy1">&gt;&gt;</span> n<span class="sy4">;</span></span></span> &#35774;&#32622; <code>eofbit</code> &#65292;&#20294;&#19981;&#35774;&#32622; <code>failbit</code> &#65306;&#25104;&#21151;&#20998;&#26512;&#25972;&#25968; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="nu0">1</span></span></span> &#24182;&#23384;&#20648;&#20043;&#20110; <code>n</code> &#12290;&#21478;&#19968;&#26041;&#38754;&#65292; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span> b<span class="sy4">;</span> istringstream buf<span class="br0">(</span><span class="st0">&quot;tr&quot;</span><span class="br0">)</span><span class="sy4">;</span> buf <span class="sy1">&gt;&gt;</span> boolalpha <span class="sy1">&gt;&gt;</span> b<span class="sy4">;</span></span></span> &#19968;&#21516;&#35774;&#32622; <code>eofbit</code> &#21644; <code>failbit</code> &#65306;&#26080;&#36275;&#22815;&#30340;&#23383;&#31526;&#23436;&#25104;&#24067;&#23572; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">true</span></span></span> &#30340;&#20998;&#26512;&#12290;</li>
<li><a href="cpp-io-basic_istream-operator_gtgt2.html"><tt>operator&gt;&gt;<span class="t-dsc-small">std::basic_istream</span></tt></a> &#30340;&#23383;&#31526;&#37322;&#20986;&#37325;&#36733;&#65292;&#33509;&#22312;&#37322;&#20986;&#23383;&#31526;&#25968;&#37327;&#19978;&#30340;&#38480;&#21046;&#65288;&#33509;&#23384;&#22312;&#65289;&#21069;&#25269;&#36798;&#27969;&#32467;&#23614;&#12290;</li>
<li><span class="t-lc"><a href="cpp-io-manip-get_time.html">std::get_time</a></span> I/O &#25805;&#32437;&#31526;&#21644;&#20219;&#20309; <span class="t-lc"><a href="cpp-locale-time_get.html">std::time_get</a></span> &#20998;&#26512;&#20989;&#25968;&#65306; <a href="cpp-locale-time_get-get.html"><tt>time_get::get</tt></a> &#12289; <a href="cpp-locale-time_get-get_time.html"><tt>time_get::get_time</tt></a> &#12289; <a href="cpp-locale-time_get-get_date.html"><tt>time_get::get_date</tt></a> &#31561;&#65292;&#33509;&#22312;&#20998;&#26512;&#26399;&#24453;&#30340;&#34987;&#22788;&#29702;&#26085;&#26399;/&#26102;&#38388;&#20540;&#25152;&#38656;&#30340;&#26368;&#26411;&#23383;&#31526;&#21069;&#25269;&#36798;&#27969;&#32467;&#23614;&#12290;</li>
<li><span class="t-lc"><a href="cpp-io-manip-get_money.html">std::get_money</a></span> I/O &#25805;&#32437;&#31526;&#21644; <a href="cpp-locale-money_get-get.html"><tt>money_get::get</tt></a> &#20989;&#25968;&#65292;&#33509;&#22312;&#20998;&#26512;&#26399;&#24453;&#30340;&#34987;&#22788;&#29702;&#36135;&#24065;&#20540;&#25152;&#38656;&#30340;&#26368;&#26411;&#23383;&#31526;&#21069;&#25269;&#36798;&#27969;&#32467;&#23614;&#12290;</li>
<li><a href="cpp-io-basic_istream-sentry.html"><tt>basic_istream::sentry</tt></a> &#26500;&#36896;&#20989;&#25968;&#65292;&#22312;&#27599;&#20010;&#26377;&#26684;&#24335;&#36755;&#20837;&#20989;&#25968;&#30340;&#36215;&#22987;&#25191;&#34892;&#65306;&#38500;&#38750;&#26410;&#35774;&#32622; <code>skipws</code> &#65288;&#20363;&#22914;&#36890;&#36807;&#21457;&#24067; <span class="t-lc"><a href="cpp-io-manip-skipws.html">std::noskipws</a></span> &#65289;&#65292;&#21542;&#21017; sentry &#20250;&#35835;&#21462;&#24182;&#33293;&#24323;&#21069;&#23548;&#31354;&#30333;&#23383;&#31526;&#12290;&#33509;&#22312;&#27492;&#25805;&#20316;&#20013;&#25269;&#36798;&#27969;&#32467;&#23614;&#65292;&#21017;&#19968;&#21516;&#35774;&#32622; <code>eofbit</code> &#21644; <code>failbit</code> &#65292;&#24182;&#19988;&#19981;&#21457;&#29983;&#36755;&#20837;&#12290;</li>
<li>I/O &#25805;&#32437;&#31526; <span class="t-lc"><a href="cpp-io-manip-ws.html">std::ws</a></span> &#65292;&#33509;&#23427;&#22312;&#28040;&#32791;&#31354;&#30333;&#31526;&#26102;&#25269;&#36798;&#27969;&#32467;&#23614;&#65288;&#20294;&#19981;&#21516;&#20110;&#26377;&#26684;&#24335;&#36755;&#20837; sentry &#65292;&#27492;&#24773;&#20917;&#19979;&#23427;&#19981;&#35774;&#32622; <code>failbit</code> &#65289;</li>
<li>&#26080;&#26684;&#24335;&#36755;&#20837;&#20989;&#25968; <a href="cpp-io-basic_istream-read.html"><tt>basic_istream::read</tt></a> &#12289; <a href="cpp-io-basic_istream-get.html"><tt>basic_istream::get</tt></a> &#12289; <a href="cpp-io-basic_istream-peek.html"><tt>basic_istream::peek</tt></a> &#21644; <a href="cpp-io-basic_istream-getline.html"><tt>basic_istream::getline</tt></a> &#22312;&#25269;&#36798;&#27969;&#23614;&#26102;&#12290;</li>
<li>&#33293;&#24323;&#36755;&#20837;&#20989;&#25968; <a href="cpp-io-basic_istream-ignore.html"><tt>basic_istream::ignore</tt></a> &#65292;&#22312;&#25269;&#36798;&#25351;&#23450;&#30340;&#20998;&#38548;&#23383;&#31526;&#21069;&#25269;&#36798;&#27969;&#32467;&#23614;&#26102;&#12290;</li>
<li>&#31435;&#21363;&#36755;&#20837;&#20989;&#25968; <a href="cpp-io-basic_istream-readsome.html"><tt>basic_istream::readsome</tt></a> &#65292;&#33509; <a href="cpp-io-basic_streambuf-in_avail.html"><tt>basic_streambuf::in_avail</tt></a> &#36820;&#22238; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">-</span><span class="nu0">1</span></span></span></li>
</ul>
<p>&#19979;&#21015;&#20989;&#25968;&#20316;&#20026;&#21103;&#25928;&#24212;&#28165;&#38500; <code>eofbit</code> &#65306;</p>
<ul>
<li><a href="cpp-io-basic_istream-putback.html"><tt>basic_istream::putback</tt></a></li>
<li><a href="cpp-io-basic_istream-unget.html"><tt>basic_istream::unget</tt></a></li>
<li><a href="cpp-io-basic_istream-seekg.html"><tt>basic_istream::seekg</tt></a></li>
</ul>
<p>&#27880;&#24847;&#22312;&#20960;&#20046;&#25152;&#26377;&#24773;&#20917;&#19979;&#65292;&#33509;&#35774;&#32622; eofbit &#65292;&#21017;&#19968;&#21516;&#35774;&#32622; failbit &#12290;</p>
<h4><span class="mw-headline" id="failbit">failbit</span></h4>
<p>&#19979;&#21015;&#26631;&#20934;&#24211;&#20989;&#25968;&#35774;&#32622; failbit &#65306;</p>
<ul>
<li><a href="cpp-io-basic_istream-sentry.html"><tt>basic_istream::sentry</tt></a> &#26500;&#36896;&#20989;&#25968;&#65292;&#22312;&#27599;&#20010;&#36755;&#20837;&#20989;&#25968;&#36215;&#22987;&#25191;&#34892;&#65292;&#33509;&#27969;&#19978;&#24050;&#35774;&#32622; <code>eofbit</code> &#25110; <code>badbit</code> &#65292;&#25110;&#33509;&#22312;&#28040;&#32791;&#21069;&#23548;&#31354;&#30333;&#26102;&#36935;&#21040;&#27969;&#32467;&#23614;&#12290;</li>
<li><a href="cpp-io-basic_ostream-sentry.html"><tt>basic_ostream::sentry</tt></a> &#26500;&#36896;&#20989;&#25968;&#65292;&#22312;&#27599;&#20010;&#36755;&#20986;&#20989;&#25968;&#36215;&#22987;&#25191;&#34892;&#65292;&#22312;&#23454;&#29616;&#23450;&#20041;&#30340;&#26465;&#20214;&#19979;&#12290;</li>
<li><a href="cpp-string-basic_string-operator_ltltgtgt.html"><tt>operator&gt;&gt;<span class="t-dsc-small">(std::basic_string&lt;&gt;)</span></tt></a> &#65292;&#33509;&#20989;&#25968;&#26410;&#20174;&#36755;&#20837;&#27969;&#37322;&#20986;&#23383;&#31526;&#12290;</li>
<li><a href="cpp-numeric-complex-operator_ltltgtgt.html"><tt>operator&gt;&gt;<span class="t-dsc-small">(std::complex&lt;&gt;)</span></tt></a> &#65292;&#33509;&#20989;&#25968;&#26080;&#27861;&#37322;&#20986;&#21512;&#27861;&#30340;&#22797;&#25968;&#12290;</li>
<li><a href="cpp-io-basic_istream-operator_gtgt2.html"><tt>operator&gt;&gt;</tt></a> &#30340;&#23383;&#31526;&#25968;&#32452;&#21644;&#21333;&#23383;&#31526;&#37325;&#36733;&#65292;&#33509;&#23427;&#20204;&#26080;&#27861;&#37322;&#20986;&#23383;&#31526;&#12290;</li>
<li><a href="cpp-io-basic_istream-operator_gtgt.html"><tt>basic_istream::operator&gt;&gt;</tt></a> &#30340; streambuf &#37325;&#36733;&#65292;&#33509; streambuf &#21442;&#25968;&#20026;&#31354;&#25351;&#38024;&#25110;&#33509;&#27809;&#26377;&#25554;&#20837;&#23383;&#31526;&#21040; streambuf &#12290;</li>
<li><a href="cpp-io-basic_ostream-operator_ltlt.html"><tt>basic_ostream::operator&lt;&lt;</tt></a> &#30340; streambuf &#37325;&#36733;&#65292;&#33509;&#20989;&#25968;&#26410;&#25554;&#20837;&#23383;&#31526;&#12290;</li>
<li><a href="cpp-utility-bitset-operator_ltltgtgt2.html"><tt>operator&gt;&gt;<span class="t-dsc-small">(std::bitset&lt;&gt;)</span></tt></a> &#65292;&#33509;&#20989;&#25968;&#26410;&#20174;&#36755;&#20986;&#27969;&#37322;&#20986;&#23383;&#31526;&#12290;</li>
<li><span class="t-lc"><a href="cpp-string-basic_string-getline.html">std::getline</a></span> &#65292;&#33509;&#20989;&#25968;&#26410;&#37322;&#20986;&#23383;&#31526;&#65292;&#25110;&#33509;&#23427;&#35201;&#20174;&#36755;&#20837;&#27969;&#37322;&#20986; <a href="cpp-string-basic_string-max_size.html"><tt>basic_string::max_size</tt></a> &#20010;&#23383;&#31526;&#12290;</li>
<li><a href="cpp-io-basic_istream-operator_gtgt.html"><tt>basic_istream::operator&gt;&gt;</tt></a> &#30340;&#25968;&#20540;&#12289;&#25351;&#38024;&#21644;&#24067;&#23572;&#36755;&#20837;&#37325;&#36733;&#65288;&#25216;&#26415;&#19978;&#26159;&#23427;&#20204;&#35843;&#29992;&#30340; <a href="cpp-locale-num_get-get.html"><tt>num_get::get</tt></a> &#30340;&#37325;&#36733;&#65289;&#65292;&#33509;&#36755;&#20837;&#19981;&#33021;&#20998;&#26512;&#20026;&#21512;&#27861;&#20540;&#65292;&#25110;&#33509;&#20998;&#26512;&#20986;&#30340;&#20540;&#19981;&#36866;&#21512;&#20110;&#30446;&#26631;&#31867;&#22411;&#12290;</li>
<li>&#26102;&#38388;&#36755;&#20837;&#25805;&#32437;&#31526; <span class="t-lc"><a href="cpp-io-manip-get_time.html">std::get_time</a></span> &#65288;&#25216;&#26415;&#19978;&#26159;&#20854;&#25152;&#35843;&#29992;&#30340; <a href="cpp-locale-time_get-get.html"><tt>time_get::get</tt></a> &#65289;&#65292;&#33509;&#36755;&#20837;&#19981;&#33021;&#25353;&#29031;&#32473;&#23450;&#30340;&#26684;&#24335;&#23383;&#31526;&#20018;&#65292;&#26080;&#27495;&#20041;&#22320;&#20998;&#26512;&#20026;&#26102;&#38388;&#20540;&#12290;</li>
<li>&#36135;&#24065;&#36755;&#20837;&#25805;&#32437;&#31526; <span class="t-lc"><a href="cpp-io-manip-get_money.html">std::get_money</a></span> &#65288;&#25216;&#26415;&#19978;&#26159;&#20854;&#25152;&#35843;&#29992;&#30340; <a href="cpp-locale-money_get-get.html"><tt>money_get::get</tt></a> &#65289;&#65292;&#33509;&#36755;&#20837;&#19981;&#33021;&#25353;&#29031;&#26412;&#22320;&#29615;&#22659;&#35268;&#21017;&#26080;&#27495;&#20041;&#22320;&#20998;&#26512;&#20026;&#36135;&#24065;&#20540;&#12290;</li>
<li>&#25152;&#26377;<a href="cpp-named_req-RandomNumberEngine.html"><span style="font-style:italic">&#38543;&#26426;&#25968;&#24341;&#25806;</span> <span style="font-family: Georgia, &#39;DejaVu Serif&#39;, serif; font-style:italic">(RandomNumberEngine)</span></a> &#30340;&#37322;&#20986;&#20989;&#25968;&#65292;&#33509;&#36935;&#21040;&#38169;&#35823;&#36755;&#20837;&#12290;</li>
<li>&#25152;&#26377;<a href="cpp-named_req-RandomNumberDistribution.html"><span style="font-style:italic">&#38543;&#26426;&#25968;&#20998;&#24067;</span> <span style="font-family: Georgia, &#39;DejaVu Serif&#39;, serif; font-style:italic">(RandomNumberDistribution)</span></a> &#30340;&#37322;&#20986;&#20989;&#25968;&#65292;&#33509;&#36935;&#21040;&#38169;&#35823;&#36755;&#20837;&#12290;</li>
<li>&#26080;&#26684;&#24335;&#36755;&#20837;&#20989;&#25968; <a href="cpp-io-basic_istream-get.html"><tt>basic_istream::get</tt></a> &#65292;&#33509;&#23427;&#20204;&#26080;&#27861;&#37322;&#20986;&#20219;&#20309;&#23383;&#31526;&#12290;</li>
<li><a href="cpp-io-basic_istream-getline.html"><tt>basic_istream::getline</tt></a> &#65292;&#33509;&#23427;&#26410;&#37322;&#20986;&#23383;&#31526;&#65292;&#33509;&#23427;&#22635;&#20805;&#32473;&#23450;&#30340;&#32531;&#20914;&#21306;&#32780;&#26410;&#36935;&#21040;&#20998;&#38548;&#31526;&#65292;&#25110;&#33509;&#25552;&#20379;&#30340;&#32531;&#20914;&#21306;&#22823;&#23567;&#23567;&#20110; 1 &#12290;</li>
<li><a href="cpp-io-basic_istream-read.html"><tt>basic_istream::read</tt></a> &#65292;&#33509;&#22312;&#33021;&#37322;&#20986;&#25152;&#26377;&#35831;&#27714;&#30340;&#23383;&#31526;&#21069;&#65292;&#36755;&#20837;&#27969;&#19978;&#20986;&#29616;&#25991;&#20214;&#23614;&#26465;&#20214;&#12290;</li>
<li><a href="cpp-io-basic_istream-seekg.html"><tt>basic_istream::seekg</tt></a> &#22312;&#22833;&#36133;&#26102;&#12290;</li>
<li><a href="cpp-io-basic_ostream-tellp.html"><tt>basic_ostream::tellp</tt></a> &#22312;&#22833;&#36133;&#26102;&#12290;</li>
<li><span class="t-lc"><a href="cpp-io-basic_fstream.html">std::basic_fstream</a></span> &#12289; <span class="t-lc"><a href="cpp-io-basic_ifstream.html">std::basic_ifstream</a></span> &#21644; <span class="t-lc"><a href="cpp-io-basic_ofstream.html">std::basic_ofstream</a></span> &#25509;&#25910;&#25991;&#20214;&#21517;&#21442;&#25968;&#30340;&#26500;&#36896;&#20989;&#25968;&#65292;&#33509;&#26080;&#27861;&#25171;&#24320;&#25991;&#20214;&#12290;</li>
<li><a href="cpp-io-basic_fstream-open.html"><tt>basic_fstream::open</tt></a> &#12289; <a href="cpp-io-basic_ifstream-open.html"><tt>basic_ifstream::open</tt></a> &#21644; <a href="cpp-io-basic_ofstream-open.html"><tt>basic_ofstream::open</tt></a> &#65292;&#33509;&#26080;&#27861;&#25171;&#24320;&#25991;&#20214;&#12290;</li>
<li><a href="cpp-io-basic_fstream-close.html"><tt>basic_fstream::close</tt></a> &#12289; <a href="cpp-io-basic_ifstream-close.html"><tt>basic_ifstream::close</tt></a> &#21644; <a href="cpp-io-basic_ofstream-close.html"><tt>basic_ofstream::close</tt></a> &#65292;&#33509;&#26080;&#27861;&#20851;&#38381;&#25991;&#20214;&#12290;</li>
</ul>
<h4><span class="mw-headline" id="badbit">badbit</span></h4>
<p>&#19979;&#21015;&#26631;&#20934;&#24211;&#20989;&#25968;&#35774;&#32622; badbit &#65306;</p>
<ul>
<li><a href="cpp-io-basic_ostream-put.html"><tt>basic_ostream::put</tt></a> &#65292;&#33509;&#23427;&#22240;&#20219;&#20309;&#21407;&#22240;&#26080;&#27861;&#25554;&#20837;&#20803;&#32032;&#21040;&#36755;&#20986;&#27969;&#12290;</li>
<li><a href="cpp-io-basic_ostream-write.html"><tt>basic_ostream::write</tt></a> &#65292;&#33509;&#23427;&#22240;&#20219;&#20309;&#21407;&#22240;&#26080;&#27861;&#25554;&#20837;&#20803;&#32032;&#21040;&#36755;&#20986;&#27969;&#12290;</li>
<li>&#26377;&#26684;&#24335;&#36755;&#20986;&#20989;&#25968; <a href="cpp-io-basic_ostream-operator_ltlt.html">operator&lt;&lt;</a> &#12289; <span class="t-lc"><a href="cpp-io-manip-put_money.html">std::put_money</a></span> &#21644; <span class="t-lc"><a href="cpp-io-manip-put_time.html">std::put_time</a></span> &#65292;&#33509;&#23427;&#20204;&#22312;&#23436;&#25104;&#36755;&#20986;&#21069;&#36935;&#21040;&#36755;&#20986;&#27969;&#30340;&#32467;&#23614;&#12290;</li>
<li><a href="cpp-io-basic_ios-init.html"><tt>basic_ios::init</tt></a> &#65292;&#22312;&#20197;&#23545;&#20110; <code>rdbuf()</code> &#30340;&#31354;&#25351;&#38024;&#35843;&#29992;&#20197;&#21021;&#22987;&#21270;&#27969;&#26102;&#12290;</li>
<li><a href="cpp-io-basic_istream-putback.html"><tt>basic_istream::putback</tt></a> &#21644; <a href="cpp-io-basic_istream-unget.html"><tt>basic_istream::unget</tt></a> &#65292;&#22312;&#20197;&#31354;&#30340; <code>rdbuf()</code> &#22312;&#27969;&#19978;&#35843;&#29992;&#26102;</li>
<li><a href="cpp-io-basic_ostream-operator_ltlt.html"><tt>basic_ostream::operator&lt;&lt;<span class="t-dsc-small">(basic_streambuf*)</span></tt></a> &#65292;&#20256;&#36882;&#31354;&#25351;&#38024;&#20026;&#21442;&#25968;&#26102;&#12290;</li>
<li><a href="cpp-io-basic_istream-putback.html"><tt>basic_istream::putback</tt></a> &#21644; <a href="cpp-io-basic_istream-unget.html"><tt>basic_istream::unget</tt></a> &#65292;&#33509;</li>
</ul>
<p><span class="t-c"><span class="mw-geshi cpp source-cpp">rdbuf<span class="br0">(</span><span class="br0">)</span><span class="sy2">-</span><span class="sy1">&gt;</span>sputbackc<span class="br0">(</span><span class="br0">)</span></span></span> &#25110; <span class="t-c"><span class="mw-geshi cpp source-cpp">rdbuf<span class="br0">(</span><span class="br0">)</span><span class="sy2">-</span><span class="sy1">&gt;</span>sungetc<span class="br0">(</span><span class="br0">)</span></span></span> &#36820;&#22238; <span class="t-c"><span class="mw-geshi cpp source-cpp">traits<span class="sy4">::</span><span class="me2">eof</span><span class="br0">(</span><span class="br0">)</span></span></span> &#12290;</p>
<ul>
<li><a href="cpp-io-basic_istream-sync.html"><tt>basic_istream::sync</tt></a> &#12289; <a href="cpp-io-basic_ostream-flush.html"><tt>basic_ostream::flush</tt></a> &#21644; <code>unitbuf</code> &#36755;&#20986;&#27969;&#19978;&#30340;&#27599;&#20010;&#36755;&#20986;&#20989;&#25968;&#65292;&#33509; <span class="t-c"><span class="mw-geshi cpp source-cpp">rdbuf<span class="br0">(</span><span class="br0">)</span><span class="sy2">-</span><span class="sy1">&gt;</span>pubsync<span class="br0">(</span><span class="br0">)</span></span></span> &#36820;&#22238; <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">-</span><span class="nu0">1</span></span></span> &#12290;</li>
<li>&#27599;&#20010;&#27969; I/O &#20989;&#25968;&#65292;&#33509;&#20219;&#20309;&#20851;&#32852;&#27969;&#32531;&#20914;&#30340;&#25104;&#21592;&#20989;&#25968;&#65288;&#22914; sbumpc() &#12289; xsputn() &#12289; sgetc() &#12289; overflow() &#31561;&#65289;&#25243;&#20986;&#24322;&#24120;&#12290;</li>
<li><a href="cpp-io-ios_base-iword.html"><tt>ios_base::iword</tt></a> &#21644; <a href="cpp-io-ios_base-pword.html"><tt>ios_base::pword</tt></a> &#22312;&#22833;&#36133;&#26102;&#65288;&#20363;&#22914;&#26080;&#27861;&#20998;&#37197;&#20869;&#23384;&#65289;&#12290;</li>
</ul>
<h3><span class="mw-headline" id=".E7.A4.BA.E4.BE.8B">&#31034;&#20363;</span></h3>
<table class="metadata plainlinks ambox mbox-small-left ambox-notice" style="">
<tr>
<td class="mbox-empty-cell"></td>
<td class="mbox-text" style="">&#26412;&#33410;&#26410;&#23436;&#25104;<br />
&#21407;&#22240;&#65306;&#26242;&#26080;&#31034;&#20363;</td>
</tr>
</table>
<h3><span class="mw-headline" id=".E5.8F.82.E9.98.85">&#21442;&#38405;</span></h3>
<p>&#19979;&#34920;&#26174;&#31034; <code>basic_ios</code> &#35775;&#38382;&#22120;&#65288; <a href="cpp-io-basic_ios-good.html"><tt>good()</tt></a>&#12289; <a href="cpp-io-basic_ios-fail.html"><tt>fail()</tt></a> &#31561;&#65289;&#23545;&#20110; <strong class="selflink"><tt>ios_base::iostate</tt></strong> &#26631;&#24535;&#30340;&#25152;&#26377;&#21487;&#33021;&#32452;&#21512;&#30340;&#20540;&#65306;</p>
<table class="wikitable" style="font-size:85%; text-align:center;">
<tr>
<td colspan="3"><strong class="selflink"><tt>ios_base::iostate</tt></strong> &#26631;&#24535;</td>
<td colspan="6"><code>basic_ios</code> &#35775;&#38382;&#22120;</td>
</tr>
<tr>
<td>eofbit</td>
<td>failbit</td>
<td>badbit</td>
<td><a href="cpp-io-basic_ios-good.html"><tt>good()</tt></a></td>
<td><a href="cpp-io-basic_ios-fail.html"><tt>fail()</tt></a></td>
<td><a href="cpp-io-basic_ios-bad.html"><tt>bad()</tt></a></td>
<td><a href="cpp-io-basic_ios-eof.html"><tt>eof()</tt></a></td>
<td><a href="cpp-io-basic_ios-operator_bool.html"><tt>operator bool</tt></a></td>
<td><a href="cpp-io-basic_ios-operator!.html"><tt>operator!</tt></a></td>
</tr>
<tr>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
</tr>
<tr>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
</tr>
<tr>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
</tr>
<tr>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
</tr>
<tr>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
</tr>
<tr>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
</tr>
<tr>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
</tr>
<tr>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
<td style="background:#ff9090; color:black; vertical-align: middle; text-align: center;" class="table-no">false</td>
<td style="background: #90ff90; color: black; vertical-align: middle; text-align: center;" class="table-yes">true</td>
</tr>
</table>
<table class="t-dsc-begin">
<tr class="t-dsc">
<td>
<div class="t-dsc-member-div">
<div><a href="cpp-io-basic_ios-rdstate.html"><span class="t-lines"><span>rdstate</span></span></a></div>
</div>
</td>
<td>&#36820;&#22238;&#29366;&#24577;&#26631;&#24535;<br />
<span class="t-mark">(<code>std::basic_ios&lt;CharT,Traits&gt;</code> &#30340;&#20844;&#24320;&#25104;&#21592;&#20989;&#25968;)</span></td>
</tr>
<tr class="t-dsc">
<td>
<div class="t-dsc-member-div">
<div><a href="cpp-io-basic_ios-setstate.html"><span class="t-lines"><span>setstate</span></span></a></div>
</div>
</td>
<td>&#35774;&#32622;&#29366;&#24577;&#26631;&#24535;<br />
<span class="t-mark">(<code>std::basic_ios&lt;CharT,Traits&gt;</code> &#30340;&#20844;&#24320;&#25104;&#21592;&#20989;&#25968;)</span></td>
</tr>
<tr class="t-dsc">
<td>
<div class="t-dsc-member-div">
<div><a href="cpp-io-basic_ios-clear.html"><span class="t-lines"><span>clear</span></span></a></div>
</div>
</td>
<td>&#20462;&#25913;&#29366;&#24577;&#26631;&#24535;<br />
<span class="t-mark">(<code>std::basic_ios&lt;CharT,Traits&gt;</code> &#30340;&#20844;&#24320;&#25104;&#21592;&#20989;&#25968;)</span></td>
</tr>
</table>
</div>
<div class="visualClear"></div>
</div>
</div>
</div>
</body>
</html>