欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

【C++ Primer Plus】編程練習(xí)答案——第17章

 1 // chapter17.h
 2 
 3 #ifndef LEARN_CPP_CHAPTER17_H
 4 #define LEARN_CPP_CHAPTER17_H
 5 
 6 #include <iostream>
 7 #include <fstream>
 8 #include <vector>
 9 #include <algorithm>
10 #include <cstring>
11 
12 void ch17_1();
13 void ch17_2(const std::string filename);
14 void ch17_3(const std::string infilename, const std::string outfilename);
15 void ch17_4(const std::string infilename1, const std::string infilename2, const std::string outfilename);
16 void ch17_5(const std::string matfile, const std::string patfile, const std::string matnpatfile);
17 void ch17_6();
18 void ShowStr(const std::string & str);
19 void GetStrs(std::ifstream & fin, std::vector<std::string> & vistr);
20 void ch17_7();
21 
22 class Store {
23 private:
24     char * str;
25     std::ofstream * outf;
26 public:
27     Store(std::ofstream & fout) : outf(&fout) {
28         str = new char[1024];
29     }
30     Store(const Store & s) {
31         if (this == &s)
32             delete [] str;
33         str = new char[1024];
34         strcpy(str, s.str);
35         outf = s.outf;
36     }
37     bool operator()(const std::string & s) {
38         int len = s.size();
39         if (outf->is_open()) {
40             outf -> write((char *)&len, sizeof(int));
41             outf -> write(s.data(), len);
42             return true;
43         }
44         else {
45             exit(EXIT_FAILURE);
46             return false;
47         }
48     }
49 };
50 
51 
52 #endif //LEARN_CPP_CHAPTER17_H

當(dāng)前名稱:【C++ Primer Plus】編程練習(xí)答案——第17章
文章位置:http://chinadenli.net/article42/dsogohc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版網(wǎng)站策劃、做網(wǎng)站企業(yè)建站、網(wǎng)站設(shè)計(jì)公司、微信小程序

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)