原创 第14周-項目2-兩個成員的類模板(2)

問題及代碼: /*Copyright (c)2016,煙臺大學計算機與控制工程學院 *All rights reserved. *文件名稱:main.cpp *作 者:王藝霖 *完成日期:2016年5月31日 *版 本 號:v1.0

原创 第14周-項目2-兩個成員的類模板(1)

問題及代碼: /*Copyright (c)2016,煙臺大學計算機與控制工程學院 *All rights reserved. *文件名稱:main.cpp *作 者:王藝霖 *完成日期:2016年5月31日 *版 本 號:v1.0

原创 第15周-閱讀程序(2)

問題及代碼: #include <functional> #include <numeric> #include <vector> #include <iostream> using namespace std; int main() {

原创 第15周-閱讀程序(5)

#include <iterator> #include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace st

原创 第14周-閱讀程序(2)

#include <iostream> #include <vector> using namespace std; int main() { vector<int> intList; vector<int>::itera

原创 文件的創建與刪除

文件的創建與刪除 create系統調用的格式 #include <fcntl.h> int creat(path,mode) const char *path; int mode; 參數與功能說明: 該調用創建名爲path的文件。如果pa

原创 C++關於指針----參考圖

指向對象的指針,指向數據成員的指針,指向成員函數的指針; 數組即指針,數組的指針,指針數組; 指向函數的指針,指向類的成員函數的指針,指針作爲函數參數,指針函數; 指針的指針,指向數組的指針;常指針,指向常對象的指針; ……

原创 第16周-項目1-小玩文件

問題及代碼: /*Copyright (c)2016,煙臺大學計算機與控制工程學院 *All rights reserved. *文件名稱:main.cpp *作 者:王藝霖 *完成日期:2016年6月17日 *版 本 號:v1.0

原创 第16周-閱讀程序4(3)

#include <iostream> #include <fstream> using namespace std; int main() { fstream outfile,infile; outfile.open("

原创 第16周-項目3-電子詞典

問題及代碼: /*Copyright (c)2016,煙臺大學計算機與控制工程學院 *All rights reserved. *文件名稱:main.cpp *作 者:王藝霖 *完成日期:2016年6月17日 *版 本 號:v1.0

原创 實例1-2-輸入兩個數,輸出較大者。

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace 實例1_2 { class Prog

原创 第16周-閱讀程序4(2)

#include <fstream> using namespace std; int main () { long pos; ofstream outfile; outfile.open ("test.txt")

原创 將一組數據保存在字符數組中

 #include <strstream> using namespace std; struct student { int num; char name[20]; float score; }; int main

原创 第16周-課堂習題-體驗二進制文件

#include <iostream> #include<fstream> #include<cstdlib> using namespace std; int main() { int a; ofstream outfi

原创 字符串流

 文件流是以外存文件爲輸入輸出對象的數據流,字符串流不是以外存文件爲輸入輸出的對象,而以內存中用戶定義的字符數組(字符串)爲輸入輸出的對象,即將數據輸出到內存中的字符數組,或者從字符數組(字符串)將數據讀入。字符串流也稱爲內存流。 字