第十五周 閱讀程式(3)

2021-07-03 07:28:04 字數 1276 閱讀 2448

/* 

* 檔名稱:test.cpp

* 作 者:呼亞萍

* 完成日期:2023年6月15日

* 版 本 號:v1.0

* * 問題描述: 閱讀下面的程式,指出其功能,體會seekg()、tellg()等函式的功能及其用法

* 程式輸入:相應的程式

* 程式輸出:對應得結果

*/#include#include using namespace std;

const char * filename = "a.txt";

int main ()

運算結果:

運算結果:

cout運算結果:

知識點總結:

seekg()函式功能:以參照位置為基礎移動若干位元組。用法:seekg(位移量,參照位置)

tellg()函式功能:得到輸入檔案位置標記的當前位置。用法:tellg()

學習心得:

使用以上函式可以準確指明應讀寫的位置呢,十分巧妙與簡單!

第十五周閱讀程式(3)

問題及 檔名稱 zwj.cpp 作 者 張偉晶 完成日期 2016年6月3日 版 本 號 v1.0 問題描述 閱讀程式,對照執行結果,領會stl的用法 輸入描述 程式輸出 include include include include include include using namespace ...

第十五周閱讀程式 3

檔名稱 text.cpp 完成日期 2016年6月5日 版本號 vc 6.0 問題描述 閱讀下面程式,並寫出執行結果 include include include include include include using namespace std int main int b const in...

第十五周 閱讀程式(1)

檔名稱 test.cpp 作 者 呼亞萍 完成日期 2015年6月15日 版 本 號 v1.0 程式輸入 相應的程式 程式輸出 對應得結果 include include include using namespace std int main int a ofstream outfile f1.d...