??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品久久久久久久app,99久久无色码中文字幕人妻,久久精品国产亚洲AV香蕉http://www.shnenglu.com/yuqilin1228/category/7165.html路在脚下zh-cnFri, 26 Mar 2010 21:08:52 GMTFri, 26 Mar 2010 21:08:52 GMT60【C++常识】C++的iostream标准库介l?/title><link>http://www.shnenglu.com/yuqilin1228/archive/2010/03/26/110620.html</link><dc:creator>LynnRaymond</dc:creator><author>LynnRaymond</author><pubDate>Fri, 26 Mar 2010 14:03:00 GMT</pubDate><guid>http://www.shnenglu.com/yuqilin1228/archive/2010/03/26/110620.html</guid><wfw:comment>http://www.shnenglu.com/yuqilin1228/comments/110620.html</wfw:comment><comments>http://www.shnenglu.com/yuqilin1228/archive/2010/03/26/110620.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/yuqilin1228/comments/commentRss/110620.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/yuqilin1228/services/trackbacks/110620.html</trackback:ping><description><![CDATA[<strong> Z么需要iostream 我们从一开始就一直在利用C++的输入输出在做着各种l习Q输入输出是由iostream库提供的Q所以讨论此标准库是有必要的Q它与C语言? stdio库不同,它从一开始就是用多重l承与虚拟承实现的面向对象的层ơ结构,作ؓ一个c++的标准库lg提供l程序员使用?</strong> <p><strong>   iostream为内|类型类型对象提供了输入输出支持Q同时也支持文g的输入输出,cȝ设计者可以通过对iostream? 的扩展,来支持自定义cd的输入输出操作?</strong> </p> <p><strong>   Z么说要扩展才能提供支持呢Q我们来一个示例?%CODE{"cpp"}% #include <stdio.h> #include <iostream></iostream>using namespace std; </strong> </p> <p><strong> class Test { public: Test(int a=0,int b=0) { Test::a=a; Test::b=b; } int a; int b; }; int main() { Test t(100,50); printf("%???",t);//不明的输出格式 scanf("%???",t);//不明的输入格式 cout<<t<<endl;//同样不够明确 cin>>t;//同样不够明确 system("pause"); } %ENDCODE% ׃自定义类的特D性,在上面的代码中,无论你用c风格的输入输出,或者是c++的输入输出都不是不明的一个表C,׃c语言没有q算W重载机 ӞDstdio库的不可扩充性,让我们无法让printf()和scanf()支持对自定义cd象的扩充识别Q而c++是可以通过q算W重载机制扩? iostream库的Qɾpȝ能能够识别自定义cdQ从而让输入输出明确的知道他们该q什么,格式是什么?</strong> </p> <p><strong>   在上例中我们之所以用printf与coutq行Ҏ目的是ؓ了告诉大ӞC与C++处理输入输出的根本不同,我们从cq的? 入输出可以很明显看出是函数调用方式,而c++的则是对象模式,cout和cin是ostreamcdistreamcȝ对象?</strong> </p> <h3><a name="2 fstream: ifstream ?ofstream"></a>1 iostream: istream ?ostream </h3> <strong>   C++中的iostream库主要包含下图所C的几个头文? </strong> <table class="twikiTable" border="0" cellpadding="1" cellspacing="1"> <tbody> <tr class="twikiTableEven"> <th class="twikiFirstCol" colspan="2" maxcols="0" bgcolor="#dadada">IOSstream ?</th> </tr> <tr class="twikiTableOdd"> <td class="twikiFirstCol" bgcolor="#eaeaea"><strong> fstream </strong> </td> <td bgcolor="#eaeaea"><strong> iomainip </strong> </td> </tr> <tr class="twikiTableEven"> <td class="twikiFirstCol" bgcolor="#ffffff"><strong> ios </strong> </td> <td bgcolor="#ffffff"><strong> iosfwd </strong> </td> </tr> <tr class="twikiTableOdd"> <td class="twikiFirstCol" bgcolor="#eaeaea"><strong> iostream </strong> </td> <td bgcolor="#eaeaea"><strong> istream </strong> </td> </tr> <tr class="twikiTableEven"> <td class="twikiFirstCol" bgcolor="#ffffff"><strong> ostream </strong> </td> <td bgcolor="#ffffff"><strong> sstream </strong> </td> </tr> <tr class="twikiTableOdd"> <td class="twikiFirstCol twikilast" bgcolor="#eaeaea"><strong> streambuf </strong> </td> <td class="twikiLast" bgcolor="#eaeaea"><strong> strstream </strong> </td> </tr> </tbody> </table> <p><strong>   我们所熟悉的输入输出操作分别是由istream(输入?和ostream(输出?q两个类提供的,Z允许双向的输入/ 输出Q由istream和ostreamzZiostreamcR?</strong> </p> <p><strong>   cȝl承关系见下图:<br><img alt="" src="http://www.pconline.com.cn/pcedu/empolder/gj/c/0504/pic/05cppios02.gif"> </strong> </p> <p><strong> iostream库定义了以下三个标准对象: </strong> </p> <ol> <li><strong> cinQ表C标准输?standard input)的istreamcd象。cin使我们可以从讑֤d数据?</strong> </li> <li><strong> coutQ表C标准输?standard output)的ostreamcd象。cout使我们可以向讑֤输出或者写数据?</strong> </li> <li><strong> cerrQ表C标准错?standard error)的osttreamcd象。cerr是导出程序错误消息的地方Q它只能允许向屏q设备写数据?</strong> </li> </ol> <p><strong>   输出主要由重载的左移操作W(<<Q来完成Q输入主要由重蝲的右UL作符(>>)完成: </strong> </p> <ol> <li><strong> >>a表示数据放入a对象中?</strong> </li> <li><strong> <<a表示a对象中存储的数据拿出?</strong> </li> </ol> <p><strong>   q些标准的流对象都有默认的所对应的设备,见下表:<br></strong> <table class="twikiTable" border="0" cellpadding="1" cellspacing="1"> <tbody> <tr class="twikiTableEven"> <th class="twikiFirstCol" maxcols="0" bgcolor="#dadada"><a title="Sort by this column" style="color: #000000;" rel="nofollow"><u>C++对象?/u></a> </th> <th maxcols="0" bgcolor="#dadada"><a title="Sort by this column" style="color: #000000;" rel="nofollow"><u>讑֤名称</u></a> </th> <th maxcols="0" bgcolor="#dadada"><a title="Sort by this column" style="color: #000000;" rel="nofollow"><u>C中标准设备名</u></a> </th> <th maxcols="0" bgcolor="#dadada"><a title="Sort by this column" style="color: #000000;" rel="nofollow"><u>默认含义</u></a> </th> </tr> <tr class="twikiTableOdd"> <td class="twikiFirstCol" align="middle" bgcolor="#eaeaea"><strong> cin </strong> </td> <td align="middle" bgcolor="#eaeaea"><strong> 键盘 </strong> </td> <td align="middle" bgcolor="#eaeaea"><strong> stdin </strong> </td> <td align="middle" bgcolor="#eaeaea"><strong> 标准输入 </strong> </td> </tr> <tr class="twikiTableEven"> <td class="twikiFirstCol" align="middle" bgcolor="#ffffff"><strong> cout </strong> </td> <td align="middle" bgcolor="#ffffff"><strong> 昄器屏q?</strong> </td> <td align="middle" bgcolor="#ffffff"><strong> stdout </strong> </td> <td align="middle" bgcolor="#ffffff"><strong> 标准输出 </strong> </td> </tr> <tr class="twikiTableOdd"> <td class="twikiFirstCol twikilast" align="middle" bgcolor="#eaeaea"><strong> cerr </strong> </td> <td class="twikiLast" align="middle" bgcolor="#eaeaea"><strong> 昄器屏q?</strong> </td> <td class="twikiLast" align="middle" bgcolor="#eaeaea"><strong> stderr </strong> </td> <td class="twikiLast" align="middle" bgcolor="#eaeaea"><strong> 标准错误输出 </strong> </td> </tr> </tbody> </table> <strong>   上表中的意思表明cin对象的默认输入设备是键盘Qcout对象的默认输备是昄器屏q?</strong> </p> <p><strong>   那么原理上E++有是如何利用cinQcout对象与左Ud右移q算W重载来实现输入输出的呢Q?</strong> </p> <p><strong>   下面我们以输Zؓ例,说明其实现原理: </strong> </p> <ol> <li><strong> cout是ostreamcȝ对象Q因为它所指向的是标准讑֤Q显C器屏幕Q,所以它在iostream头文件中作ؓ? 局对象q行定义?</strong> </li> <li><strong> ostream cout(stdout);//光认指向的C中的标准讑֤名,作ؓ其构造函数的参数使用? </strong> </li> <li><strong> 在iostream.h头文件中Qostreamcd应每个基本数据类型都有其友元函数对左UL作符q行了友 元函数的重蝲?</strong> <ul> <li><strong> ostream& operator<<(ostream &temp,int source); </strong> </li> <li><strong> ostream& operator<<(ostream &temp,char *ps); </strong> </li> <li><strong> ... {等 </strong> </li> </ul> </li> </ol> <p><strong>   一句输句:cout<<"www.cndev-lab.com"Q,事实上调用的是 ostream& operator<<(ostream &temp,char *ps);q个q算W重载函敎ͼ׃q回的是对象的引用Q引用可以作为左g用,所以当E序中有cMcout<<"www.cndev- lab.com"<<"中国软g开发实验室";q样的语句出现的时候,p够构成连l输出?</strong> </p> <p><strong>   ׃iostream库不光支持对象的输入输出Q同时也支持文g的输入输出Q所以在详细讲解左移与右U运符重蝲只前Q我? 有必要先Ҏ件的输入输出以及输入输出的控制符有所了解?</strong> </p> <h3><a name="2 fstream: ifstream ?ofstream"></a>2 fstream: ifstream ? ofstream </h3> <strong>   和文件有关系的输入输出类主要在fstream.hq个头文件中被定义,在这个头文g中主要被定义了三个类Q由q三个类控制Ҏ件的 各种输入输出操作Q他们分别是ifstream、ofstream、fstreamQ其中fstreamcL由iostreamcL生而来Q他们之间的l? 承关p见下图所C?br><img alt="" src="http://www.pconline.com.cn/pcedu/empolder/gj/c/0504/pic/05cppios04.gif"> </strong> <p><strong> ׃文g讑֤q不像显C器屏幕与键盘那h标准默认讑֤Q所以它在fstream.h头文件中是没有像cout那样预先定义的全局 对象Q所以我们必自己定义一个该cȝ对象Q我们要以文件作备向文g输出信息(也就是向文g写数?Q那么就应该使用ofstreamcR?</strong> </p> <p><strong>   ofstreamcȝ默认构造函数原形ؓQ?%CODE{"cpp"}% ofstream::ofstream(const char *filename,int mode = ios::out,int openprot = filebuf::openprot); %ENDCODE% </strong> </p> <ul> <li><strong> filenameQ  要打开的文件名 </strong> </li> <li><strong> modeQ    要打开文g的方?</strong> </li> <li><strong> protQ    打开文g的属?</strong> </li> </ul> <p><strong>   其中mode和openprotq两个参数的可选项表见下表Q?</strong> <table class="twikiTable" border="0" cellpadding="1" cellspacing="1"> <tbody> <tr class="twikiTableEven"> <td class="twikiFirstCol" colspan="2" align="middle" bgcolor="#eaeaea"><strong> mode 属性表 </strong> </td> </tr> <tr class="twikiTableOdd"> <td class="twikiFirstCol" bgcolor="#ffffff"><strong> ios::app </strong> </td> <td bgcolor="#ffffff"><strong> 以追加的方式打开文g </strong> </td> </tr> <tr class="twikiTableEven"> <td class="twikiFirstCol" bgcolor="#eaeaea"><strong> ios::ate </strong> </td> <td bgcolor="#eaeaea"><strong> 文g打开后定位到文g,ios:app包含有此属?</strong> </td> </tr> <tr class="twikiTableOdd"> <td class="twikiFirstCol" bgcolor="#ffffff"><strong> ios::binary </strong> </td> <td bgcolor="#ffffff"><strong> 以二q制方式打开文gQ缺省的方式是文本方式。两U方式的区别见前?</strong> </td> </tr> <tr class="twikiTableEven"> <td class="twikiFirstCol" bgcolor="#eaeaea"><strong> ios::in </strong> </td> <td bgcolor="#eaeaea"><strong> 文g以输入方式打开 </strong> </td> </tr> <tr class="twikiTableOdd"> <td class="twikiFirstCol" bgcolor="#ffffff"><strong> ios::out </strong> </td> <td bgcolor="#ffffff"><strong> 文g以输出方式打开 </strong> </td> </tr> <tr class="twikiTableEven"> <td class="twikiFirstCol twikilast" bgcolor="#eaeaea"><strong> ios::trunc </strong> </td> <td class="twikiLast" bgcolor="#eaeaea"><strong> 如果文g存在Q把文g长度设ؓ0 </strong> </td> </tr> </tbody> </table> <strong>   可以?#8220;?#8221;把以上属性连接v来,如ios::out|ios::binary?</strong> <table class="twikiTable" border="0" cellpadding="1" cellspacing="1"> <tbody> <tr class="twikiTableEven"> <td class="twikiFirstCol" colspan="2" align="middle" bgcolor="#eaeaea"><strong> openprot 属性表 </strong> </td> </tr> <tr class="twikiTableOdd"> <td class="twikiFirstCol" bgcolor="#ffffff"><strong> 属?</strong> </td> <td align="middle" bgcolor="#ffffff"><strong> 含义 </strong> </td> </tr> <tr class="twikiTableEven"> <td class="twikiFirstCol" bgcolor="#eaeaea"><strong> 0 </strong> </td> <td bgcolor="#eaeaea"><strong> 普通文Ӟ打开讉K </strong> </td> </tr> <tr class="twikiTableOdd"> <td class="twikiFirstCol" bgcolor="#ffffff"><strong> 1 </strong> </td> <td bgcolor="#ffffff"><strong> 只读文g </strong> </td> </tr> <tr class="twikiTableEven"> <td class="twikiFirstCol" bgcolor="#eaeaea"><strong> 2 </strong> </td> <td bgcolor="#eaeaea"><strong> 隐含文g </strong> </td> </tr> <tr class="twikiTableOdd"> <td class="twikiFirstCol twikilast" bgcolor="#ffffff"><strong> 4 </strong> </td> <td class="twikiLast" bgcolor="#ffffff"><strong> pȝ文g </strong> </td> </tr> </tbody> </table> <strong>   可以?#8220;?#8221;或?#8220;+”把以上属性连接v?Q如3?|2是以只d隐含属性打开文g?</strong> </p> <p><strong> 实例代码如下Q?%CODE{"cpp"}% #include <fstream></fstream>using namespace std; </strong> </p> <p><strong> int main() { ofstream myfile("c:\\1.txt",ios::out|ios::trunc,0); myfile<<"中国软g开发实验室"<<endl<<"|址Q?<<"www.cndev- lab.com"; myfile.close() system("pause"); } %ENDCODE% 文g使用完后可以使用close成员函数关闭文g?</strong> </p> <p><strong>   ios::app加模式,在用追加模式的时候同时进行文件状态的判断是一个比较好的习惯?</strong> </p> <p><strong>   CZ如下Q?</strong> </p> <p><strong> %CODE{"cpp"}% #include <iostream></iostream>#include <fstream></fstream>using namespace std; int main() { ofstream myfile("c:\\1.txt",ios::app,0); if(myfile)//或者写成myfile.fail() { cout<<"文g打开p|Q目标文件状态可能ؓ只读Q?; system("pause"); exit(1); } myfile<<"中国软g开发实验室"<<endl<<"|址Q?<<"www.cndev- lab.com"<<endl; myfile.close(); } %ENDCODE% </strong> </p> <p><strong>   在定义ifstream和ofstreamcd象的时候,我们也可以不指定文g。以后可以通过成员函数open()昑ּ的把一 个文件连接到一个类对象上?</strong> </p> <p><strong>   例如Q?</strong> </p> <p><strong> %CODE{"cpp"}% #include <iostream></iostream>#include <fstream></fstream>using namespace std; int main() { ofstream myfile; myfile.open("c:\\1.txt",ios::out|ios::app,0); if(myfile)//或者写成myfile.fail() { cout<<"文g创徏p|,盘不可写或者文件ؓ只读!"; system("pause"); exit(1); } myfile<<"中国软g开发实验室"<<endl<<"|址Q?<<"www.cndev- lab.com"<<endl; myfile.close(); } %ENDCODE% 下面我们来看一下是如何利用ifstreamcd象,文件中的数据读取出来,然后再输出到标准讑֤中的例子?</strong> </p> <p><strong>   代码如下Q?%CODE{"cpp"}% #include <iostream></iostream>#include <fstream></fstream>#include <string></string>using namespace std; int main() { ifstream myfile; myfile.open("c:\\1.txt",ios::in,0); if(myfile) { cout<<"文g读错?; system("pause"); exit(1); } char ch; string content; while(myfile.get(ch)) { content+=ch; cout.put(ch);//cout<<ch;q么写也是可以的 } myfile.close(); cout<<content; system("pause"); } %ENDCODE% 上例中,我们利用成员函数get()Q逐一的读取文件中的有效字W,再利用put()成员函数Q将文g中的数据通过循环逐一输出到标准设?屏幕) 上, get()成员函数会在文gd默尾的时候返回假|所以我们可以利用它的这个特性作为while循环的终止条Ӟ我们同时也在上例中引入了C++风格? 字符串类型stringQ在循环d的时候逐一保存到content中,要用stringcdQ必d含string.h的头文g?</strong> </p> <p><strong>  </strong> </p> <p><strong> 我们在简单介l过ofstreamcdifstreamcdQ我们再来看一下fstreamc,fstreamcL? iostreamz而来Qfstreamcd象可以同Ҏ件进行读写操作?</strong> </p> <p><strong>   CZ代码如下Q?%CODE{"cpp"}% #include <iostream></iostream>#include <fstream></fstream>using namespace std; int main() { fstream myfile; myfile.open("c:\\1.txt",ios::out|ios::app,0); if(myfile) { cout<<"文g写错?文g属性可能ؓ只读!"<<endl; system("pause"); exit(1); } myfile<<"中国软g开发实验室"<<endl<<"|址Q?<<"www.cndev- lab.com"<<endl; myfile.close(); </strong> </p> <p><strong> myfile.open("c:\\1.txt",ios::in,0); if(myfile) { cout<<"文g读错?文g可能丢失!"<<endl; system("pause"); exit(1); } char ch; while(myfile.get(ch)) { cout.put(ch); } myfile.close(); system("pause"); } %ENDCODE% ׃fstreamcd以对文g同时q行d操作Q所以对它的对象q行初始话的时候一定要昑ּ的指定mode和openprot参数?</strong> </p> <p><strong>   接下来我们来学习一下串类的基知识Q什么叫串流c? </strong> </p> <h3><a name="3 strstream: ostrstream ?istrs"></a>3 strstream: ostrstream ?istrstream </h3> <strong>   单的理解是能够控制字符串类型对象进行输入输出的c,C++不光可以支持C++风格的字W串控Ӟq可以支持C风格的字W串? 控制?</strong> <p><strong>   我们先看看看C++是如何对C风格的字W串进行控制的QC中的字符串其实也是字符数组Q字W数l内的数据在内存中的位置? 排列是连l的Q我们通常?char str[size]或者char *str的方式声明创建C风格字符数组Qؓ了能让字W数l作备ƈ提供输入输出操作QC++引入了ostrstream、istrstream? strstreamq三个类Q要使用他们创徏对象必d含strstream.h头文件?</strong> </p> <ul> <li><strong> istrstreamcȝ于执行C风格的串的输入操作Q也是以字W串数组作ؓ输入讑֤?</strong> </li> <li><strong> ostrstreamcȝ于执行C风格的串的输出操作Q也是一字符串数l作备?</strong> </li> <li><strong> strstreamcd时可以支持C风格的串的输入输出操作?</strong> </li> </ul> <p><strong>   istrstreamcL从istreamQ输入流c)和strstreambaseQ字W串基c)z? 来,ostrstream是从 ostreamQ输出流c)和strstreambaseQ字W串基c)z而来Qstrstream则是从iostream(输入输出类)和和 strstreambaseQ字W串基c)z而来?</strong> </p> <p><strong>   他们的承关pd下图所C?<br><img alt="" src="http://www.pconline.com.cn/pcedu/empolder/gj/c/0504/pic/05cppios05.gif"> </strong> </p> <p><strong>   串流同样不是标准讑֤Q不会有预先定义好的全局对象Q所以不能直接操作,需要通过构造函数创建对象?</strong> </p> <p><strong> cistrstream的构造函数原形如下: %CODE{"cpp"}% istrstream::istrstream(const char *str,int size); %ENDCODE% 参数1表示字符串数l?而参?表示数组大小Q当size?Ӟ表示istrstreamcd象直接连接到由str所指向的内存空间ƈ以\0l尾? 字符丌Ӏ?</strong> </p> <p><strong>   下面的示例代码就是利用istrstreamcd建类对象Q制定流输入讑֤为字W串数组Q通过它向一个字W型对象输入数据。代 码如下: %CODE{"cpp"}% #include <iostream></iostream>#include <strstream></strstream>using namespace std; int main() { char *name = "www.cndev-lab.com"; int arraysize = strlen(name)+1; istrstream is(name,arraysize); char temp; is>>temp; cout<<temp; system("pause"); } %ENDCODE% costrstream用于执行串流的输出,它的构造函数如下所C: %CODE{"cpp"}% ostrstream::ostrstream(char *_Ptr,int streamsize,int Mode = ios::out); %ENDCODE%   W一个参数是字符数组Q第二个是说明数l的大小Q第三个参数是指打开方式?</strong> </p> <p><strong>   我们来一个示例代码: %CODE{"cpp"}% #include <iostream></iostream>#include <strstream></strstream>using namespace std; int main() { int arraysize=1; char *pbuffer=new char[arraysize]; ostrstream ostr(pbuffer,arraysize,ios::out); ostr<<arraysize<<ends;//使用ostrstream输出到流对象的时?要用endsl束字符? cout<<pbuffer; delete[] pbuffer; system("pause"); } %ENDCODE% 上面的代码中Q我们创Z个c风格的串输出对象ostrQ我们将arraysize内的数据成功的以字符串的形式输出Costr对象所指向? pbuffer指针的堆I间中,pbuffer也正是我们要输出的字W串数组Q在l尾要用endsl束字符Ԍ如果不这么做有溢出的危险?</strong> </p> <h3><a name="4 stringstream"></a>4 stringstream </h3> <strong> 对于stringstream了来_不用我多_大家也已l知道它是用于C++风格的字W串的输入输出的? stringstream的构造函数原形如下: %CODE{"cpp"}%   stringstream::stringstream(string str); %ENDCODE%   CZ代码如下: %CODE{"cpp"}% #include <iostream></iostream>#include <sstream></sstream>#include <string></string>using namespace std; </strong> <p><strong> int main() { stringstream ostr("ccc"); ostr.put('d'); ostr.put('e'); ostr<<"fg"; string gstr = ostr.str(); cout<<gstr<<endl; </strong> </p> <p><strong> char a; ostr>>a; cout<<a </strong> </p> <p><strong> system("pause"); } %ENDCODE% 除此而外Qstringstreamcȝ对象我们q常用它q行string与各U内|类型数据之间的转换。示例代码如下: %CODE{"cpp"}% #include <iostream></iostream>#include <sstream></sstream>#include <string></string>using namespace std; </strong> </p> <p><strong> int main() { stringstream sstr; //--------int转string----------- int a=100; string str; sstr<<a; sstr>>str; cout<<str<<endl; //--------string转char[]-------- sstr.clear();//如果你想通过使用同一stringstream对象实现多种cd的{换,h意在每一ơ{换之后都必须调用clear() 成员函数?string name = "colinguan"; char cname[200]; sstr<<name; sstr>>cname; cout<<cname; system("pause"); } %ENDCODE% 接下来我们来学习一下输?输出的状态标志的相关知识. </strong> </p> <h3><a name="5 io_state 输入/输出的状态标?></a>5 io_state 输入/输出的状态标?</h3> <strong> C++中负责的输入/输出的系l包括了关于每一个输?输出操作的结果的记录信息。这些当前的状态信息被包含在io_statecd的对 象中。io_state是一个枚丄型(像open_mode一PQ以下便是它包含的倹{?</strong> <ul> <li><strong> goodbit 无错?</strong> </li> <li><strong> Eofbit 已到达文件尾 </strong> </li> <li><strong> failbit 非致命的输入/输出错误Q可挽回 </strong> </li> <li><strong> badbit 致命的输?输出错误,无法挽回 </strong> </li> </ul> <p><strong> 有两U方法可以获得输?输出的状态信息。一U方法是通过调用rdstate()函数Q它返回当前状态的错误标记。例如,假如? 有Q何错误,则rdstate()会返回goodbit.下例CZQ表C出了rdstate()的用法: %CODE{"cpp"}% #include <iostream></iostream>using namespace std; </strong> </p> <p><strong> int main() { int a; cin>>a; cout<<cin.rdstate()<<endl; if(cin.rdstate() == ios::goodbit) { cout<<"输入数据的类型正,无错误!"<<endl; } if(cin.rdstate() == ios_base::failbit) { cout<<"输入数据cd错误Q非致命错误Q可清除输入~冲区挽回!"<<endl; } system("pause"); } %ENDCODE%   另一U方法则是用下面Q何一个函数来相应的输入/输出状态: %CODE{"cpp"}% bool bad(); bool eof(); bool fail(); bool good(); %ENDCODE% </strong> </p> <p><strong>   下例CZQ表C出了上面各成员函数的用法: %CODE{"cpp"}% #include <iostream></iostream>using namespace std; </strong> </p> <p><strong> int main() { int a; cin>>a; cout<<cin.rdstate()<<endl; if(cin.good()) { cout<<"输入数据的类型正,无错误!"<<endl; } if(cin.fail()) { cout<<"输入数据cd错误Q非致命错误Q可清除输入~冲区挽回!"<<endl; } system("pause"); } %ENDCODE% 如果错误发生Q那么流状态既被标Cؓ错误Q你必须清除q些错误状态,以你的E序能正适当地l运行。要清除错误状态,需使用clear()函数? 此函数带一个参敎ͼ它是你将要设为当前状态的标志倹{,只要ios::goodbit作ؓ实参?</strong> </p> <p><strong>   CZ代码如下Q?%CODE{"cpp"}% #include <iostream></iostream>using namespace std; </strong> </p> <p><strong> int main() { int a; cin>>a; cout<<cin.rdstate()<<endl; cin.clear(ios::goodbit); cout<<cin.rdstate()<<endl; system("pause"); } %ENDCODE% 通常当我们发现输入有错又需要改正的时候,使用clear()更改标记为正后Q同时也需要用get()成员函数清除输入~冲区,以达到重复输入的? 的?</strong> </p> <p><strong>   CZ代码如下Q?%CODE{"cpp"}% #include <iostream></iostream>using namespace std; </strong> </p> <p><strong> int main() { int a; while(1) { cin>>a; if(cin)//条g可改写ؓcin.fail() { cout<<"输入有错!请重新输?<<endl; cin.clear(); cin.get(); } else { cout<<a; break; } } system("pause"); } %ENDCODE%   最后再l出一个对文g错误标记处理的例子Qm固学习,代码如下Q? %CODE{"cpp"}% #include <iostream></iostream>#include <fstream></fstream>using namespace std; </strong> </p> <p><strong> int main() { ifstream myfile("c:\\1.txt",ios_base::in,0); if(myfile.fail()) { cout<<"文gdp|或指定文件不存在!"<<endl; } else { char ch; while(myfile.get(ch)) { cout<<ch; } if(myfile.eof()) { cout<<"文g内容已经全部d"<<endl; } while(myfile.get(ch)) { cout<<ch; } } system("pause"); } %ENDCODE%  </strong> </p> <br> <img src ="http://www.shnenglu.com/yuqilin1228/aggbug/110620.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/yuqilin1228/" target="_blank">LynnRaymond</a> 2010-03-26 22:03 <a href="http://www.shnenglu.com/yuqilin1228/archive/2010/03/26/110620.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【C++常识】C++输入输出?/title><link>http://www.shnenglu.com/yuqilin1228/archive/2010/03/26/110619.html</link><dc:creator>LynnRaymond</dc:creator><author>LynnRaymond</author><pubDate>Fri, 26 Mar 2010 14:01:00 GMT</pubDate><guid>http://www.shnenglu.com/yuqilin1228/archive/2010/03/26/110619.html</guid><wfw:comment>http://www.shnenglu.com/yuqilin1228/comments/110619.html</wfw:comment><comments>http://www.shnenglu.com/yuqilin1228/archive/2010/03/26/110619.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/yuqilin1228/comments/commentRss/110619.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/yuqilin1228/services/trackbacks/110619.html</trackback:ping><description><![CDATA[<p>C++ 通过以下几个cL持文件的输入输出Q?/p> <ul> <li>ofstream: 写操作(输出Q的文gc?(由ostream引申而来) </li> <li>ifstream: L作(输入Q的文gc?由istream引申而来) </li> <li>fstream: 可同时读写操作的文gc?(由iostream引申而来) </li> </ul> <p> </p> <h3>打开文g(Open a file)</h3> <p>对这些类的一个对象所做的W一个操作通常是它和一个真正的文g联系hQ也是说打开一个文件。被打开的文件在E序中由一个流对象 (stream object)来表C?(q些cȝ一个实? Q而对q个对象所做的M输入输出操作实际是对该文g所做的操作?/p> <p>要通过一个流对象打开一个文Ӟ我们使用它的成员函数open()Q?/p> <p><code><font face="NSimsun">void open (const char * filename, openmode mode);</font></code>q里filename 是一个字W串Q代表要打开的文件名Qmode 是以下标志符的一个组合:</p> <table border="1" cellpadding="3" cellspacing="0"> <tbody> <tr> <td>ios::in</td> <td>??而打开 文g</td> </tr> <tr> <td>ios::out</td> <td>??而打开 文g</td> </tr> <tr> <td>ios::ate</td> <td>初始位置Q文件尾</td> </tr> <tr> <td>ios::app</td> <td>所有输出附加在文g 末尾</td> </tr> <tr> <td>ios::trunc</td> <td>如果文g已存在则? 删除该文?/td> </tr> <tr> <td>ios::binary</td> <td>二进制方?/td> </tr> </tbody> </table> <p>q些标识W可以被l合使用Q中间以”?#8221;操作W?|)间隔。例如,如果我们惌以二q制方式打开文g”example.bin” 来写入一些数据,我们可以通过以下方式调用成员函数openQ)来实玎ͼ</p> <p><code><font face="NSimsun">ofstream file;<br>file.open ("example.bin", ios::out | ios::app | ios::binary); </font></code>ofstream, ifstream ?fstream所有这些类的成员函数open 都包含了一个默认打开文g的方式,q三个类的默认方式各不相同:</p> <table border="1" cellpadding="3" cellspacing="0"> <tbody> <tr> <th>c?/th> <th>参数的默认方?/th> </tr> <tr> <td>ofstream</td> <td>ios::out | ios::trunc</td> </tr> <tr> <td>ifstream</td> <td>ios::in</td> </tr> <tr> <td>fstream</td> <td>ios::in | ios::out</td> </tr> </tbody> </table> <p>只有当函数被调用时没有声明方式参数的情况下,默认值才会被采用。如果函数被调用时声明了M参数Q默认值将被完全改写,而不会与调用参数l合?/p> <p>׃对类ofstream, ifstream ?fstream 的对象所q行的第一个操作通常都是打开文gQ这些类都有一个构造函数可以直接调用open 函数Qƈ拥有同样的参数。这P我们可以通过以下方式q行与上面同L定义对象和打开文g的操作:</p> <p><code><font face="NSimsun">ofstream file ("example.bin", ios::out | ios::app | ios::binary);</font></code>两种打开文g的方式都是正的?/p> <p>你可以通过调用成员函数is_open()来检查一个文件是否已l被利的打开了:</p> <p><code><font face="NSimsun">bool is_open();</font></code>它返回一个布?bool) |为真QtrueQ代表文件已l被利打开Q假( false )则相反?/p> <h3>关闭文g(Closing a file)</h3> <p>当文件读写操作完成之后,我们必须文件关闭以使文仉新变为可讉K的。关闭文仉要调用成员函数close()Q它负责缓存中的数据排攑և来ƈ 关闭文g。它的格式很单:</p> <p><code><font face="NSimsun">void close ();</font></code>q个函数一旦被调用Q原先的? 对象(stream object)可以被用来打开其它的文件了Q这个文件也可以重新被其它的进E?process)所有访问了?/p> <p>为防止流对象被销毁时q联pȝ打开的文Ӟ析构函数(destructor)会自动调用关闭函数close?/p> <h3>文本文g(Text mode files)</h3> <p>cofstream, ifstream 和fstream 是分别从ostream, istream 和iostream 中引甌来的。这是Z?fstream 的对象可以用其父类的成员来讉K数据?/p> <p>一般来_我们用这些类与同控制?console)交互同样的成员函?cin ? cout)来进行输入输出。如下面的例题所C,我们使用重蝲的插入操作符<<Q?/p> <table border="2" cellpadding="1" cellspacing="1" width="400"> <tbody> <tr> <td><font color="#008000">// writing on a text file</font><br>#include <fiostream.h>int main () {<br>ofstream examplefile (”example.txt”);<br>if (examplefile.is_open()) {<br>examplefile << “This is a line.\n”;<br>examplefile << “This is another line.\n”;<br>examplefile.close();<br>}<br>return 0;<br>}</td> <td><font color="#008000">file example.txt<br></font>This is a line.<br>This is another line.</td> </tr> </tbody> </table> <p>从文件中d数据也可以用?cin的用同LҎQ?/p> <table border="2" cellpadding="1" cellspacing="1" width="400"> <tbody> <tr> <td><font color="#008000">// reading a text file</font><br>#include <iostream.h><br>#include <fstream.h><br>#include <stdlib.h>int main () {<br>char buffer[256];<br>ifstream examplefile (”example.txt”);<br>if (! examplefile.is_open())<br>{ cout << “Error opening file”; exit (1); }<br>while (! examplefile.eof() ) {<br>examplefile.getline (buffer,100);<br>cout << buffer << endl;<br>}<br>return 0;<br>}</td> <td>This is a line.<br>This is another line.</td> </tr> </tbody> </table> <p>上面的例子读入一个文本文件的内容Q然后将它打印到屏幕上。注意我们用了一个新的成员函数叫做eof Q它是ifstream 从类 ios 中承过来的Q当到达文g末尾时返回true ?/p> <h3>状态标志符的验?Verification of state flags)</h3> <p>除了eof()以外Q还有一些验证流的状态的成员函数Q所有都q回bool型返回|Q?/p> <ul> <li><strong> bad()</strong> 如果在读写过E中出错Q返?true 。例如:当我们要对一个不是打开为写状态的文gq行写入Ӟ或者我们要写入的设备没有剩余空间的时候? </li> <li><strong> fail()</strong> 除了与bad() 同样的情况下会返?true 以外Q加上格式错误时也返回true Q例如当惌d一个整敎ͼ而获得了一个字母的时候? </li> <li><strong> eof()</strong> 如果L件到达文件末,q回true? </li> <li><strong> good()</strong> q是最通用的:如果调用以上M一个函数返回true 的话Q此函数q回 false ?</li> </ul> <p>要想重置以上成员函数所查的状态标志,你可以用成员函数clear()Q没有参数?/p> <h3>获得和设|流指针(get and put stream pointers)</h3> <p>所有输?输出对?i/o streams objects)都有臛_一个流指针Q?/p> <ul> <li>ifstreamQ?cMistream, 有一个被UCؓget pointer的指针,指向下一个将被读取的元素? </li> <li>ofstream, cM ostream, 有一个指?put pointer Q指向写入下一个元素的位置? </li> <li>fstream, cM iostream, 同时l承了get ?put </li> </ul> <p>我们可以通过使用以下成员函数来读出或配置q些指向中d位置的流指针Q?/p> <ul> <li><strong> tellg() ?tellp()</strong> q两个成员函C用传入参敎ͼq回pos_type cd的?ҎANSI-C++ 标准) Q就是一个整敎ͼ代表当前get 指针的位置 (用tellg) ?put 指针的位置(用tellp). </li> <li><strong> seekg() 和seekp()</strong> q对函数分别用来改变指针get 和put的位|。两个函数都被重载ؓ两种不同的原型: <p>seekg ( pos_type position );<br>seekp ( pos_type position );</p> <p>使用q个原型Q流指针被改变ؓ指向从文件开始计的一个绝对位|。要求传入的参数cd与函?tellg 和tellp 的返回值类型相同?/p> <p>seekg ( off_type offset, seekdir direction );<br>seekp ( off_type offset, seekdir direction );</p> <p>使用q个原型可以指定由参数direction军_的一个具体的指针开始计的一个位U?offset)。它可以是:</p> <table border="1" cellpadding="3" cellspacing="0"> <tbody> <tr> <td>ios::beg</td> <td>从流开始位 |计的位移</td> </tr> <tr> <td>ios::cur</td> <td>从流指针? 前位|开始计的位移</td> </tr> <tr> <td>ios::end</td> <td>从流末尾? 开始计的位移</td> </tr> </tbody> </table> </li> </ul> <p>?指针 get ?put 的值对文本文g(text file)和二q制文g(binary file)的计方法都是不同的Q因为文本模式的文g中某些特D字W可能被修改。由于这个原因,对以文本文g模式打开的文件L使用seekg ? seekp的第一U原型,而且不要对tellg ?tellp 的返回D行修攏V对二进制文Ӟ你可以Q意用这些函敎ͼ应该不会有Q何意外的行ؓ产生?/p> <p>以下例子使用q些函数来获得一个二q制文g的大:</p> <table border="2" cellpadding="1" cellspacing="1" width="400"> <tbody> <tr> <td><font color="#008000">// obtaining file size<br><font color="#000000">#include <iostream.h><br>#include <fstream.h></font></font><font color="#008000"><font color="#000000">const char * filename = “example.txt”;</font></font><font color="#008000"><font color="#000000">int main () {<br>long l,m;<br>ifstream file (filename, ios::in|ios::binary);<br>l = file.tellg();<br>file.seekg (0, ios::end);<br>m = file.tellg();<br>file.close();<br>cout << “size of ” << filename;<br>cout << ” is ” << (m-l) << ” bytes.\n”;<br>return 0;<br>}</font></font></td> <td>size of example.txt<br>is 40 bytes.</td> </tr> </tbody> </table> <h3>二进制文?Binary files)</h3> <p>在二q制文g中,使用<< ?gt;>Q以及函敎ͼ如getlineQ来操作W输入和输出数据Q没有什么实际意义,虽然它们是符合语法的?/p> <p>?件流包括两个为顺序读写数据特D设计的成员函数Qwrite ?read。第一个函?(write) 是ostream 的一个成员函敎ͼ都是被ofstream所l承。而read 是istream 的一个成员函敎ͼ被ifstream 所l承。类 fstream 的对象同时拥有这两个函数。它们的原型是:</p> <p>write ( char * buffer, streamsize size );<br>read ( char * buffer, streamsize size );</p> <p>q里 buffer 是一块内存的地址Q用来存储或d数据。参数size 是一个整数|表示要从~存QbufferQ中d或写入的字符数?/p> <table border="2" cellpadding="1" cellspacing="1" width="400"> <tbody> <tr> <td><font color="#008000"><font color="#008000">// reading binary file</font><br><font color="#000000">#include <iostream><br>#include <fstream.h></font></font><font color="#008000"><font color="#000000">const char * filename = “example.txt”;</font></font><font color="#008000"><font color="#000000">int main () {<br>char * buffer;<br>long size;<br>ifstream file (filename, ios::in|ios::binary|ios::ate);<br>size = file.tellg();<br>file.seekg (0, ios::beg);<br>buffer = new char [size];<br>file.read (buffer, size);<br>file.close();</font></font><font color="#008000"><font color="#000000">cout << “the complete file is in a buffer”;</font></font><font color="#008000"><font color="#000000">delete[] buffer;<br>return 0;<br>}</font></font></td> <td>The complete file<br>is in a buffer</td> </tr> </tbody> </table> <h3>~存和同?Buffers and Synchronization)</h3> <p>?我们Ҏ件流q行操作的时候,它们与一个streambuf cd的缓?buffer)联系在一赗这个缓存(bufferQ实际是一块内存空_作ؓ?stream)和物理文件的媒介。例如,对于一个输出流Q? 每次成员函数put (写一个单个字W?被调用,q个字符不是直接被写入该输出所对应的物理文件中的,而是首先被插入到该流的缓存(bufferQ中?/p> <p>当缓存被排放出来(flush)Ӟ它里面的所有数据或者被写入物理媒质中(如果是一个输出流的话Q,或者简单的被抹?如果是一个输入流的话)? q个q程UCؓ同步(synchronization)Q它会在以下M情况下发生:</p> <ul> <li><strong> 当文件被关闭?</strong> 在文件被关闭之前Q所有还没有被完全写出或d的缓存都被同步? </li> <li><strong> 当缓存buffer 满时:</strong> ~存Buffers 有一定的I间限制。当~存满时Q它会被自动同步? </li> <li><strong> 控制W明指?</strong> 当遇到流中某些特定的控制W时Q同步会发生。这些控制符包括Qflush 和endl? </li> <li><strong> 明确调用函数sync():</strong> 调用成员函数sync() (无参?可以引发立即同步。这个函数返回一个int |{于-1 表示没有联pȝ~存或操作失败?</li> </ul> <br><img src ="http://www.shnenglu.com/yuqilin1228/aggbug/110619.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/yuqilin1228/" target="_blank">LynnRaymond</a> 2010-03-26 22:01 <a href="http://www.shnenglu.com/yuqilin1228/archive/2010/03/26/110619.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【C++常识】C/C++头文件一?/title><link>http://www.shnenglu.com/yuqilin1228/archive/2010/03/26/110613.html</link><dc:creator>LynnRaymond</dc:creator><author>LynnRaymond</author><pubDate>Fri, 26 Mar 2010 13:39:00 GMT</pubDate><guid>http://www.shnenglu.com/yuqilin1228/archive/2010/03/26/110613.html</guid><wfw:comment>http://www.shnenglu.com/yuqilin1228/comments/110613.html</wfw:comment><comments>http://www.shnenglu.com/yuqilin1228/archive/2010/03/26/110613.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/yuqilin1228/comments/commentRss/110613.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/yuqilin1228/services/trackbacks/110613.html</trackback:ping><description><![CDATA[<strong> <font size="2">C、传l?C++<br><br>#include <assert.h>    //讑֮插入?br>#include <ctype.h>     //字符处理<br>#include <errno.h>     //定义错误?br>#include <float.h>     //点数处?br>#include <fstream.h>    //文g输入Q输?br>#include <iomanip.h> //参数化输入/输出<br>#include <iostream.h>   //数据输入/输出<br>#include <limits.h>    //定义各种数据cd最值常?br>#include <locale.h>    //定义本地化函?br>#include <math.h>     //定义数学函数<br>#include <stdio.h>     //定义输入Q输出函?br>#include <stdlib.h>    //定义杂项函数及内存分配函?br>#include <string.h>    //字符串处?br>#include <strstrea.h>   //Z数组的输入/输出<br>#include <time.h>     //定义关于旉的函?br>#include <wchar.h> //宽字W处理及输入Q输?br>#include <wctype.h>    //宽字W分c?br><br>//////////////////////////////////////////////////////////////////////////<br><br>? ?C++ Q同上的不再注释Q?br><br>#include <algorithm>    //STL 通用法<br>#include <bitset>     //STL 位集容器<br>#include <cctype><br>#include <cerrno><br>#include <clocale><br>#include <cmath><br>#include <complex>     //复数c?br>#include <cstdio><br>#include <cstdlib><br>#include <cstring><br>#include <ctime><br>#include <deque>      //STL 双端队列容器<br>#include <exception> //异常处理c?br>#include <fstream><br>#include <functional>   //STL 定义q算函数Q代替运符Q?br>#include <limits><br>#include <list>      //STL U性列表容?br>#include <map>       //STL 映射容器<br>#include <iomanip><br>#include <ios>       //基本输入Q输出支?br>#include <iosfwd>     //输入Q输出系l用的前置声明<br>#include <iostream><br>#include <istream>     //基本输入?br>#include <ostream>     //基本输出?br>#include <queue>      //STL 队列容器<br>#include <set>       //STL 集合容器<br>#include <sstream>     //Z字符串的?br>#include <stack>      //STL 堆栈容器    <br>#include <stdexcept>    //标准异常c?br>#include <streambuf>    //底层输入Q输出支?br>#include <string>     //字符串类<br>#include <utility>     //STL 通用模板c?br>#include <vector>     //STL 动态数l容?br>#include <cwchar><br>#include <cwctype><br><br>using namespace std;<br><br>//////////////////////////////////////////////////////////////////////////<br><br>C99 增加<br><br>#include <complex.h>   //复数处理<br>#include <fenv.h>    //点环境<br>#include <inttypes.h>  //整数格式转换<br>#include <stdbool.h>   //布尔环境<br>#include <stdint.h>   //整型环境<br>#include <tgmath.h>   //通用cd数学?/font>C/C++ 头文件一?br><!----><br></strong> <font size="2"><strong> C、传l?C++<br><br>#include <assert.h>    //讑֮插入?br>#include <ctype.h>     //字符处理<br>#include <errno.h>     //定义错误?br>#include <float.h>     //点数处?br>#include <fstream.h>    //文g输入Q输?br>#include <iomanip.h>    //参数化输入/输出<br>#include <iostream.h>   //数据输入/输出<br>#include <limits.h>    //定义各种数据cd最值常?br>#include <locale.h>    //定义本地化函?br>#include <math.h>     //定义数学函数<br>#include <stdio.h>     //定义输入Q输出函?br>#include <stdlib.h>    //定义杂项函数及内存分配函?br>#include <string.h>    //字符串处?br>#include <strstrea.h>   //Z数组的输入/输出<br>#include <time.h>     //定义关于旉的函?br>#include <wchar.h> //宽字W处理及输入Q输?br>#include <wctype.h>    //宽字W分c?br><br>//////////////////////////////////////////////////////////////////////////<br><br>? ?C++ Q同上的不再注释Q?br><br>#include <algorithm>    //STL 通用法<br>#include <bitset>     //STL 位集容器<br>#include <cctype><br>#include <cerrno><br>#include <clocale><br>#include <cmath><br>#include <complex>     //复数c?br>#include <cstdio><br>#include <cstdlib><br>#include <cstring><br>#include <ctime><br>#include <deque>      //STL 双端队列容器<br>#include <exception> //异常处理c?br>#include <fstream><br>#include <functional>   //STL 定义q算函数Q代替运符Q?br>#include <limits><br>#include <list>      //STL U性列表容?br>#include <map>       //STL 映射容器<br>#include <iomanip><br>#include <ios>       //基本输入Q输出支?br>#include <iosfwd>     //输入Q输出系l用的前置声明<br>#include <iostream><br>#include <istream>     //基本输入?br>#include <ostream>     //基本输出?br>#include <queue>      //STL 队列容器<br>#include <set>       //STL 集合容器<br>#include <sstream>     //Z字符串的?br>#include <stack>      //STL 堆栈容器    <br>#include <stdexcept>    //标准异常c?br>#include <streambuf>    //底层输入Q输出支?br>#include <string>     //字符串类<br>#include <utility>     //STL 通用模板c?br>#include <vector>     //STL 动态数l容?br>#include <cwchar><br>#include <cwctype><br><br>using namespace std;<br><br>//////////////////////////////////////////////////////////////////////////<br><br>C99 增加<br><br>#include <complex.h>   //复数处理<br>#include <fenv.h>    //点环境<br>#include <inttypes.h>  //整数格式转换<br>#include <stdbool.h>   //布尔环境<br>#include <stdint.h>   //整型环境<br>#include <tgmath.h>   //通用cd数学?/strong> </font><br> <br> <img src ="http://www.shnenglu.com/yuqilin1228/aggbug/110613.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/yuqilin1228/" target="_blank">LynnRaymond</a> 2010-03-26 21:39 <a href="http://www.shnenglu.com/yuqilin1228/archive/2010/03/26/110613.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.zqek.cn" target="_blank">AVվþþƷ</a>| <a href="http://www.710p.cn" target="_blank">þþƷѿ</a>| <a href="http://www.gybyz.cn" target="_blank">޾ƷþþþĻ69</a>| <a href="http://www.yes365cc.cn" target="_blank">þ˽˹Ʒ</a>| <a href="http://www.p7751.cn" target="_blank">97Ʒ97þþþþ</a>| <a href="http://www.manini.cn" target="_blank">þĻƷһ</a>| <a href="http://www.by6463.cn" target="_blank">777ҹƷþav</a>| <a href="http://www.khdv.cn" target="_blank">wwwþþcom</a>| <a href="http://www.3-gold.cn" target="_blank">þҹӰ</a>| <a href="http://www.enfb.cn" target="_blank">þù޸ۿ</a>| <a href="http://www.35zz.cn" target="_blank">þۺϺݺۺϾþ97ɫ</a>| <a href="http://www.xhlwd.cn" target="_blank">þùƷ77777</a>| <a href="http://www.ssc905.cn" target="_blank">˾þô߽ۺվ</a>| <a href="http://www.zhaopf.com.cn" target="_blank">þþŮ붯ȺëƬ </a>| <a href="http://www.ikde.cn" target="_blank">þù</a>| <a href="http://www.youarecharming.cn" target="_blank">ӰȷŮAV³ɫԴþ</a>| <a href="http://www.0x5e.cn" target="_blank">ƷŮþþ</a>| <a href="http://www.6ccccc.cn" target="_blank">޹СƵƷþþ </a>| <a href="http://www.d13722.cn" target="_blank">2021ƷþþƷ</a>| <a href="http://www.todouba.cn" target="_blank">ҹƷþþþ</a>| <a href="http://www.haoq98.cn" target="_blank">þþ뾫Ʒҹ</a>| <a href="http://www.adidas2009.cn" target="_blank">ƷۺϾþþþþ888ѿ</a>| <a href="http://www.qequ.cn" target="_blank">˾þһ</a>| <a href="http://www.zhoucheng888.cn" target="_blank">þСƵ</a>| <a href="http://www.a1dk.cn" target="_blank">þþþùƷŮӰԺ</a>| <a href="http://www.agilespring.cn" target="_blank">þۺɫݺ</a>| <a href="http://www.huliduo.cn" target="_blank">þþžѸƵ</a>| <a href="http://www.11soso.cn" target="_blank">97rþþƷ99</a>| <a href="http://www.520king.cn" target="_blank">һɫþ88ۺ޾Ʒ</a>| <a href="http://www.shecb2b.com.cn" target="_blank">ƷþþþþþþþĻ </a>| <a href="http://www.ndgbsz.cn" target="_blank">޾Ʒþþþþ</a>| <a href="http://www.lphbca.org.cn" target="_blank">þɫһ</a>| <a href="http://www.lenticular3d.cn" target="_blank">뾫Ʒþþ</a>| <a href="http://www.fcks.net.cn" target="_blank">þþƷëƬѹۿ</a>| <a href="http://www.vulm.cn" target="_blank">þҹɫƷŷ</a>| <a href="http://www.668j.cn" target="_blank">AV12þ </a>| <a href="http://www.pb-wines.cn" target="_blank">99ƷþþþĻ</a>| <a href="http://www.baozhilong.cn" target="_blank">þþƷ</a>| <a href="http://www.chianyuxun.cn" target="_blank">Ļþ2020</a>| <a href="http://www.412news.cn" target="_blank">þþù׮</a>| <a href="http://www.pp4f.cn" target="_blank">vaĻþ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>