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

正文內(nèi)容

c++畢業(yè)論文外文翻譯-全文預(yù)覽

2025-06-16 19:20 上一頁面

下一頁面
  

【正文】 用,以便在一次操作中檢查或設(shè)置多個(gè)標(biāo)志。 所有流對象都包含一個(gè)條件狀態(tài)成員,該成員由 setstate 和 clear 操作管理。如果成功輸入,則條件檢測為 true。而如果輸入 1024,則成功讀取, cin 將處于正確的無錯(cuò)誤狀態(tài)。 IO 標(biāo)準(zhǔn)庫管理一系列 條件狀態(tài)( condition state) 成員,用來標(biāo)記給定的 IO 對象是否處于可用狀態(tài),或者碰到了哪種特定的錯(cuò)誤。 . Condition States 在展 開討論 fstream 和 sstream 頭文件中定義的類型之前,需要了解更多 IO 標(biāo)準(zhǔn)庫如何管理其緩沖區(qū)及其流狀態(tài)的相關(guān)內(nèi)容。 第二個(gè)含義是:形參或返回類型也不能為流類型。其原因?qū)⒃诤竺?第三部分 和 第四部分 學(xué)習(xí)類和繼承時(shí)闡明。這些對象加上 “ w” 前綴,以此與 char 類型版本區(qū)分: wchar_t 類型的標(biāo)準(zhǔn)輸入對象是 wcin;標(biāo)準(zhǔn)輸出是 wcout;而標(biāo)準(zhǔn)錯(cuò)誤則是 wcerr。于是, wostream、 wistream 和 wiostream 類型從控制窗口讀寫 wchar_t 數(shù)據(jù)。因?yàn)? IO 類型通過繼承關(guān)聯(lián),所以可以只編寫一個(gè)函數(shù),而將它應(yīng)用到三種類型的流上:控制臺(tái)、磁盤文件或者 字符串流( string streams) 。這就意味著:對 istreamamp。也就是說,可使用 iostream 類型在同一個(gè)流上實(shí)現(xiàn)輸入和輸出操作。除了 istream 和 ostream 類型之外, iostream 頭文件還定義了 iostream 類型。因此, 圖 所示, istream 是 ifstream 和 istringstream 的基類,同時(shí)也是 iostream 的基類,而 iostream 則是 stringstream 和 fstream 的基類。在 fstream 和 sstream 里定義的每種類型都是從 iostream 頭文件中定義的相關(guān)類型派生而來。當(dāng)一個(gè)類繼承另一個(gè)類時(shí),這兩個(gè)類通??梢允褂孟嗤牟僮?。相似地,無論我們讀的是 char 類型的字符還是 wchar_t( 第 節(jié) )的字符,也都可以使用該操作符。此外,程序還應(yīng)該能方便地使用 IO 操作格式化內(nèi)存中的數(shù)據(jù),從而避免讀寫磁盤或其他設(shè)備的復(fù)雜性和運(yùn)行代價(jià)。這些話題已超出了本書的范疇。 ? getline 函數(shù),需要分別取 istream 類型和 string 類型的兩個(gè)引用形參,其功能是從 istream 對象讀取一個(gè)單詞,然后寫入 string 對象中。 ? cerr (發(fā)音為 seeerr):輸出標(biāo)準(zhǔn)錯(cuò)誤的 ostream 對象。 前面的程序 已經(jīng)使用了多種 IO 標(biāo)準(zhǔn)庫提供的 ? istream (輸入流)類型,提供輸入操作。這些 IO 類型都定義了如何讀寫內(nèi)置數(shù)據(jù)類型的值。ll see in Chapter 9, only element types that support copy can be stored in vectors or other container types. Because we cannot copy stream objects, we cannot have a vector (or other container) that holds stream objects. The second implication is that we cannot have a parameter or return type that is one of the stream types. If we need to pass or return an IO object, it must be passed or returned as a pointer or reference. Typically, we pass a stream as a nonconst reference because we pass an IO object intending to read from it or write to it. Reading or writing an IO object changes its state, so the reference must be nonconst. . Condition States Before we explore the types defined in fstream and sstream, we need to understand a bit more about how the IO library manages its buffers and the state of a stream. Keep in mind that the material we cover in this section and the next applies equally to plain streams, file streams, or string streams. Inherent in doing IO is the fact that errors can occur. Some errors are recoverable。 can be called with an ifstream or istring stream object. Similarly,a function that takes an ostreamamp。ll focus on those portions of the IO library that are most useful in ordinary programs. . An ObjectOriented Library The IO types and objects we’ ve used so far read and write streams of data and are used to interact with a user’ s console window. Of course, real programs cannot be limited to doing IO solely to or from a console window. Programs often need to read or write named files. Moreover, it can be quite convenient to use the IO operations to format data in memory, thereby avoiding the plexity and runtime expense of reading or writing to a disk or other device. Applications also may have to read and write languages that require widecharacter support. Conceptually, neither the kind of the character size affect the IO operations we want to perform. For example, we’ d like to use to read data regardless of whether we’ re reading a console window, a disk file, or an inmemory string. Similarly, we’ d like to use that operator regardless of whether the characters we read fit in a char or require the wchar_t(,) type. At first glance, the plexities involved in supporting or using these different kinds of devices and different sized character streams might seem a daunting problem. To manage the plexity, the library uses inheritance to define a set of
點(diǎn)擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計(jì)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1