原创 vector基本操作
#include <iostream>#include <vector>#include <algorithm>using namespace std; int main(){//容器的創建 vector<int> v; v
原创 map的使用:
#include <iostream>#include <map>#include <vector>#include <string>#include <fstream>#include <sstream> using names
原创 程序員的成長六個階段
一個程序員的成長六個階段 第一階段 此階段主要是能熟練地使用某種語言。 這就相當於練武中的套路和架式這些表面的東西。 第二階段 此階段能精通基於某種平臺的介面 (例如我們現在常用的Win 32的API函數) 以及所對應語言的自身的庫函數。
原创 模版重載
"max.h" #include <string> template<typename T>inline T const& maxOfObject(T const& a,T const& b){ return a>b?a:b;} te
原创 deque的基本操作
#include <iostream>#include <deque>using namespace std; int main(int argc,int **argv){ deque<int> d; d.push_back(1); d.
原创 multimap的基本操作
#include <iostream>#include <map>#include <string>using namespace std; //struct info //{// string name;// float score;/
原创 C++風格與技巧(Bjarne Stroustrup著)
目錄:我如何寫這個非常簡單的程序?爲什麼編譯要花這麼長的時間?爲什麼一個空類的大小不爲0?我必須在類聲明處賦予數據嗎?爲什麼成員函數默認不是virtual的?爲什麼析構函數默認不是virtual的?爲什麼不能有虛擬構造函數?爲什麼重載在繼
原创 Bjarne訪談:抽象與效率
提升抽象的層面 Bill Venners(以下簡稱Bill):我最初是從Borland的一個教學錄像“World of C++"”開始學習C++的。在該錄像開頭的簡短片斷中,你說你正致力於C++方面的工作是提升編程過程中的抽象層面。
原创 c++四書五經
C++是一門廣泛用於工業軟件研發的大型語言。它自身的複雜性和解決現實問題的能力,使其極具學術研究價值和工業價值。和C語言一樣,C++已經在許多重要的領域大獲成功。 然而,一個不可否認的現實是,在低階程序設計領域,C++擠壓着C同時也在
原创 string的基本操作
//字符串的基本操作 #include <iostream>#include <string>using namespace std; int main(int argc,int **argv){ //直接給字符串對象賦值 //s
原创 list基本操作
#include <iostream>#include <list>#include <algorithm>using namespace std; int main(int argc,int **argv){ list<int> l;
原创 c++流
#include<iostream>#include <string>#include <vector>#include <fstream>using namespace std; int fileToVector(string file
原创 模版的簡單使用
#include "max.h" template <typename T> inline T const& maxTwoObject(T const& a, T const& b){ return a>b?a:b;} #incl
原创 multiset的基本操作
#include <iostream>#include <set>#include <string>using namespace std; int main(int argc,int **argv){ multiset<strin
原创 STL最簡單的一例
#include <iostream>#include<vector>#include <string>#include <algorithm> using namespace std; int main(){ vector