原创 (找到原因了)(又改了下,感覺有個最下面那塊函數,應傳入指針的指針)求求哪位大神給看看吧,爲何註釋部分放開竟然會出錯,琢磨一天了啊,萬分感謝!!!!!!!!!!!!!!!!!!!!

得出的總結就是:delete的內容,必須爲new出來的,棧分配的空間肯定是不能使用delete來釋放,但堆上的也未必可以,當定義爲static string s1=“The test class is SharedPtr”時,雖然是堆上的

原创 從文件中讀取作者和書籍信息,存入multimap,使用find查找指定作者並刪除

#include <iostream> #include <fstream> #include <string> #include <map> using namespace std; int _tmain(int argc, _TCH

原创 python腳本從excel表到處數據,生成指定格式的文件

#coding:gbk #導入處理excel的模塊 import xlrd #定義哪些字段需要判斷,只支持時間字段 toSureColArray = ['CREATE_TIME','MODIFY_TIME'] #確定某個字段是否在數組

原创 容器的比較和字符串的比較

容器的比較和字符串的比較是相同的 容器的比較:優先判斷字符串的長度 ivec1:5,1,2,3,4 ivec2:0,1,2,3,4,5 string1 "51234" string2 "012345" 容器:ivec2 比 ivec1長,

原创 打開文件讀取信息,統計單詞長度大於指定值的個數

#include <vector> #include <algorithm> #include <iostream> #include <iterator> #include <list> #include <fstream> #incl

原创 C++,輸入一組數據,降序排列後,刪除三個連續元素的中間值

#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; //獲取輸入的數據 int getInp

原创 每天學點C++(二)

1、派生類與基類的關係之一 class A {}; class B : public A {  void print( A&a ) {} <1>  void printCopy( A a ) {} <2> }; <1> B b;    

原创 在類外定義的函數,被成員函數調用時,報運行時錯誤error LNK2005:已經在 classinfo.obj 中定義

問題描述:爲了確定作用域的查找過程,在類體外定義了一個函數,當函數爲普通函數時,被成員函數調用可以通過編譯             得出結論:查找函數聲明的過程爲,在成員函數實現之前,會先查找類定義,然後查找全局聲明,即便全局聲明在類體後

原创 從一個文件中讀取明密對照表,翻譯密文(註釋部分爲c++primer標準答案,非註釋部分自己寫的)

// stringconvert.cpp : 定義控制檯應用程序的入口點。 // #include <exception> #include <iostream> #include <fstream> #include <map> #in

原创 一組數據,copy一份至list,一份至vector,list中erase奇數,vector中erase偶數

#include "stdafx.h" #include <vector> #include <string> #include <iostream> #include <list> #include <algorithm> int m

原创 C++,輸入字符串,刪除重複次數最多的字符

#include <iostream> #include <map> #include <vector> #include <algorithm> #include <string> #include <cstring> using na

原创 Oracle數據庫的安裝和卸載之道

=============================================成功安裝數據庫======================================================= 1、如果安裝數據庫

原创 對指定大小的容器使用類類型對象進行初始化的理解

One example of an operation that imposes a type constraint is the constructors that take a single initializer that spec