<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC] ### 完成輸入輸出操作的C庫函數-C library to perform Input/Output operations Input and Output operations can also be performed in C++ using the C Standard Input and Output Library (cstdio, known as stdio.h in the C language). This library uses what are called streams to operate with physical devices such as keyboards, printers, terminals or with any other type of files supported by the system. Streams are an abstraction to interact with these in an uniform way; All streams have similar properties independently of the individual characteristics of the physical media they are associated with. Streams are handled in the cstdio library as pointers to FILE objects. A pointer to a FILE object uniquely identifies a stream, and is used as a parameter in the operations involving that stream. There also exist three standard streams: stdin, stdout and stderr, which are automatically created and opened for all programs using the library. *** 翻譯: 在C++中的輸入輸出操作也可以使用C標準輸入輸出庫。這個庫使用“流”這個概念來處理物理設備的輸入輸出,如鍵盤,打印機,終端或者是系統支持的其他類型的文件。流是使用同一的方式,用來和這些設備交互的抽象概念。所有的流都有相似屬性,這些屬性獨立于這些物理設備各自所具有的特有屬性。 流處理文件對象的方式是使用指針。一個指向文件對象的指針唯一標識一個流,涉及到流的操作中,可以將其作為一個參數。 一共有三個標準輸入輸出流:stdin,stdout,stderr。這三個標準輸入輸出流是自動為所有使用該庫的程序自動打開的。 ### 流屬性-Stream properties Streams have some properties that define which functions can be used on them and how these will treat the data input or output through them. Most of these properties are defined at the moment the stream is associated with a file (opened) using the fopen function: * Read/Write Access Specifies whether the stream has read or write access (or both) to the physical media they are associated with. * Text / Binary Text streams are thought to represent a set of text lines, each one ending with a new-line character. Depending on the environment where the application is run, some character translation may occur with text streams to adapt some special characters to the text file specifications of the environment. A binary stream, on the other hand, is a sequence of characters written or read from the physical media with no translation, having a one-to-one correspondence with the characters read or written to the stream. * Buffer A buffer is a block of memory where data is accumulated before being physically read or written to the associated file or device. Streams can be either fully buffered, line buffered or unbuffered. On fully buffered streams, data is read/written when the buffer is filled, on line buffered streams this happens when a new-line character is encountered, and on unbuffered streams characters are intended to be read/written as soon as possible. * Orientation On opening, streams have no orientation. As soon as an input/output operation is performed on them, they become either byte-oriented or wide-oriented, depending on the operation performed (generally, functions defined in <cstdio> are byte-oriented, while functions in <cwchar> are wide-oriented). See cwchar for more info. *** 翻譯:流有很多屬性,這些屬性規定了哪些函數可以使用它們,以及這些函數如何通過流來處理數據的輸入和輸出(這里應該是說讀寫權限)。大部分這些屬性是在文件被打開的時候所定義的,我們一般使用fopen函數來打開文件: * 讀寫權限 當前流是否有讀或者寫(或者兩者皆有)的權限,對當前物理設備。 * 文本/二進制 文本流表示了一串文本行,以換行符結束。文本流中會有某些字符轉義,這是為了適應某些特定文本格式下特殊字符的傳輸。另一方面,一個二進制流是一系列從物理設備中讀或者寫的字符,并沒有發生任何轉義,讀寫過程中字符是一一對應的。 * 緩存 一個緩存是指一塊內存區域,該區域存放在物理讀寫文件或者設備之前的數據。流緩存分為全緩存,行緩存和無緩存。全緩存中數據的讀寫發生在緩存變滿,行緩存流是當換行符鍵入的時候發生讀寫,無緩存流是盡可能去讀寫。 * 面向 在打開過程中,流并沒有指向(這里的指向是指面向字節還是面向寬字節)。(計算機網絡中有相關概念) ### 標識符-Indicators Streams have certain internal indicators that specify their current state and which affect the behavior of some input and output operations performed on them: * Error indicator This indicator is set when an error has occurred in an operation related to the stream. This indicator can be checked with the ferror function, and can be reset by calling either to clearerr, freopen or rewind. * End-Of-File indicator When set, indicates that the last reading or writing operation performed with the stream reached the End of File. It can be checked with the feof function, and can be reset by calling either to clearerr or freopen or by calling to any repositioning function (rewind, fseek and fsetpos). * Position indicator It is an internal pointer of each stream which points to the next character to be read or written in the next I/O operation. Its value can be obtained by the ftell and fgetpos functions, and can be changed using the repositioning functions rewind, fseek and fsetpos. *** 流中有自己的內部標識符,用來標記當前狀態和一些輸入輸出操作的結果: * 錯誤標識符 當流操作出錯的時候會用到,可以通過函數ferror來進行檢測,也可以通過函數clearerr,freopen,rewind來重置。 * 文件結束標識符 當最后讀寫流的操作到達文件結束時該標識符會被定義,可以通過feof相關函數進行檢測,也可以通過clearerr,freopen或者任何重定位函數來進行重置。 * 定位標識符 每個流的內部指針,指向下一個IO操作中的字符。它的值可通過函數ftell,fgetpos來獲取,也可以通過任意重定位函數進行重置。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看