freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

c畢業(yè)論文外文翻譯-免費(fèi)閱讀

  

【正文】 此時(shí),可以通過(guò)多次調(diào)用 setstate 或者 clear 函數(shù)實(shí)現(xiàn)。類似地,如果這三個(gè)條件沒(méi)有一個(gè)為 true,則 good 操作將返回 true。 每個(gè) IO 類還定義了三個(gè) iostate 類型的常量值,分別表示特定的位模式。 if 語(yǔ)句直接檢查流的狀態(tài),而 while 語(yǔ)句則檢測(cè)條件表達(dá)式返回的流,從而間接地檢查了流的狀態(tài)。一些錯(cuò)誤是可恢復(fù)的;一些錯(cuò)誤則發(fā)生在系統(tǒng)底層,位于程序可修正的范圍之外。由于流對(duì)象不能復(fù)制,因此不能存儲(chǔ)在 vector(或其他)容器中(即不存在存儲(chǔ)流對(duì)象的 vector 或其他容器)。標(biāo)準(zhǔn)庫(kù)還定義了從標(biāo)準(zhǔn)輸入輸出讀寫寬字符的對(duì)象。 類型的函數(shù)也可用 ofstream 或者 ostringstream 對(duì)象調(diào)用。這意味著 iostream 對(duì)象共享了它的兩個(gè)父類的接口。最頂端的圓圈代表基類(或稱 “ 父類 ” ),基類和派生類(或稱 “ 子類 ” )之間用線段連接。在本書(shū)的 第四部分 將會(huì)更詳細(xì)地討論繼承和面向?qū)ο蟪绦蛟O(shè)計(jì),不過(guò),一般而言,通過(guò)繼承關(guān)聯(lián)起來(lái)的類型都共享共同的接口。當(dāng)然,實(shí)際 的程序不能僅限于對(duì)控制窗口的 IO,通常還需要讀或?qū)懸衙奈募? ? 操作符,用于把輸出寫到 ostream 對(duì)象中。 本章將介紹 IO 標(biāo)準(zhǔn)庫(kù)的基礎(chǔ)知識(shí),而更多的內(nèi) 容會(huì)在后續(xù)章節(jié)中介紹: 第十四章 考慮如何編寫自己的輸入輸出操作符: 附錄 A 則介紹格式控制以及文件的隨機(jī)訪問(wèn)。 and standard error is wcerr. Each of the IO headers defines both the char and wchar_t classes and standard input/output objects. The streambased wchar_t classes and objects are defined in iostream, the wide character file stream types in fstream, and the wide character string streams in sstream. No Copy or Assign f or IO Objects For reasons that will be more apparent when we study classes and inheritance in Parts III and IV, the library types do not allow allow copy or assignment. This requirement has two particularly important implications. As we39。 Appendix A will cover ways to control formatting and random access to files. Our programs have already used many IO library facilities: ? istream (input stream) type, which supports input operations ? ostream (output stream) type, which provides output operations ? cin (pronounced seein) an istream object that reads the standard input. ? cout (pronounced seeout) an ostream object that writes to the standard output ? cerr (pronounced seeerr) an ostream object that writes to the standard error. cerr is usually used for program error messages. ? operator , which is used to read input from an istream object ? operator , which is used to write output to an ostream object ? getline function, which takes a reference to an istream and a reference to a string and reads a word from the istream into the string This chapter looks briefly at some additional IO operations, and discusses support for reading and writing files and strings. Appendix A covers how to control formatting of IO operations, support for random access to files, and support for unformatted IO. This primer does not describe the entire iostream libraryin particular, we do not cover the systemspecific implementation details, nor do we discuss the mechanisms by which the library manages input and output buffers or how we might write our own buffer classes. These topics are beyond the scope of this book. Instead, we39。 can be called with an ifstream or istring stream object. Similarly,a function that takes an ostreamamp。這些 IO 類型都定義了如何讀寫內(nèi)置數(shù)據(jù)類型的值。 ? cerr (發(fā)音為 seeerr):輸出標(biāo)準(zhǔn)錯(cuò)誤的 ostream 對(duì)象。這些話題已超出了本書(shū)的范疇。相似地,無(wú)論我們讀的是 char 類型的字符還是 wchar_t( 第 節(jié) )的字符,也都可以使用該操作符。在 fstream 和 sstream 里定義的每種類型都是從 iostream 頭文件中定義的相關(guān)類型派生而來(lái)。除了 istream 和 ostream 類型之外, iostream 頭文件還定義了 iostream 類型。這就意味著:對(duì) istreamamp。于是, wostream、 wistream 和 wiostream 類型從控制窗口讀寫 wchar_t 數(shù)據(jù)。其原因?qū)⒃诤竺?第三部分 和 第四部分 學(xué)習(xí)類和繼承時(shí)闡明。 . Condition States 在展 開(kāi)討論 fstream 和 sstream 頭文件中定義的類型之前,需要了解更多 IO 標(biāo)準(zhǔn)庫(kù)如何管理其緩沖區(qū)及其流狀態(tài)的相關(guān)內(nèi)容。而如果輸入 1024,則成功讀取, cin 將處于正確的無(wú)錯(cuò)誤狀態(tài)。 所有流對(duì)象都包含一個(gè)條件狀態(tài)成員,該成員由 setstate 和 clear 操作管理。 eofbit 是在遇到文件結(jié)束符時(shí)設(shè)置的,此時(shí)同時(shí)還設(shè)置了 failbit。除了添加的標(biāo)記狀態(tài), setstate 將保留其他已存在的狀態(tài)變量不變。對(duì)于結(jié)果中的每一個(gè)二進(jìn)制位,如果其值為 1,則該操作的兩個(gè)操作數(shù)中至少有一個(gè)的對(duì)應(yīng)二進(jìn)制位是 1。在流的使用出現(xiàn)了問(wèn) 題并做出補(bǔ)救后,如果我們希望把流重設(shè)為有效狀態(tài),則可以調(diào)用 clear 操作。如果出現(xiàn)了這類錯(cuò)誤,則該流通常就不能再繼續(xù)使用了。而某些程序則需要更詳細(xì)地訪問(wèn)或控制流的狀態(tài),此時(shí),除了知道流處于錯(cuò)誤狀態(tài)外,還必須了解它遇到了哪種類型的錯(cuò)誤。 如果在標(biāo)準(zhǔn)輸入設(shè)備輸入 Borges,則 cin 在嘗試將輸入的字符串讀為 int 型數(shù)據(jù)失敗后,會(huì)生成一個(gè)錯(cuò)誤狀態(tài)。 一般情況下,如果要傳遞 IO 對(duì)象以便對(duì)它進(jìn)行讀寫,可用非 const 引用的方式傳遞這個(gè)流對(duì)象?;诹鞯? wchar_t
點(diǎn)擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計(jì)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1