資源簡介
提供的是本書的課后習題源代碼,也就是《C++程序設計語言(特別版)題解》的源代碼。非書中源代碼。
本版本是高清版,是第1版第18次印刷,是書簽最全最好的版本。
基本信息
原書名: The C++ Programming Language, Special Edition
原出版社: Addison Wesley
作者: (美)Bjarne Stroustrup
譯者: 裘宗燕
叢書名: 計算機科學叢書
出版社:機械工業出版社
ISBN:7111102029
上架時間:2002-7-12
出版日期:2002 年7月
頁碼:936
版次:1-1
內容簡介
本書介紹了標準c++以及由c++所支持的關鍵性編程技術和設計技術。標準c++較以前的版本功能更強大,其中許多新的語言特性,如名字空間、異常、模板、運行時類型聲明等使得新技術得以直接應用。本書圍繞語言及庫功能來組織,內容涉及c++的主要特征及標準庫,并通過系統軟件領域中的實例解釋說明一些關鍵性的概念與技術。 本書的目的就是幫助讀者了解c++是如何支持編程技術的,使讀者能從中獲得新的理解,從而成為一名優秀的編程人員和設計人員。適合做高校面向對象編程課程的教科書,也可作為c++愛好者的參考書。
[center] [a href=http://www.china-pub.com/main/sale/c++tb.htm target=_blank]c++之父bjarne stroustrup博士專訪[/a]
[a href="http://www.is.pku.edu.cn/~qzy/cpp.htm" target="_blank"]《c++程序設計語言》程序的更正和更新[/a]
[a href="http://www.china-pub.com/temporary/list/cooperate/zipdownload/zg.zip" target="_blank"]本書忠告[/a] [/center]
作譯者
作者: Bjarne Stroustrup
Bjarne Stroustrup現任AT&T實驗室的大型程序設計研究部的主管。1990年,Bjarne榮獲《財富》雜志評選的“美國12位最年輕的科學家”稱號。1993年,由于在C++領域的重大貢獻,Bjarne獲得了ACM該年度的 Grace Murray Hopper大獎并成為ACM院士(成立于1947年的ACM協會是歷史最悠久、目前世界上最大的教育和科學計算協會,成為ACM院士是個人成就的里程碑)。1995年,BYTE雜志頒予他“近20年來計算機工業最具影響力的20人”的稱號。
[同作者作品]
C++ 程序設計語言(特別版)(英文影印版)
C++語言的設計和演化[按需印刷]
C++程序設計語言(特別版)
譯者: 裘宗燕
知名譯者,翻譯嚴謹,喜與讀者交流。 裘宗燕教授是北京大學數學學院信息科學系的,關心的主要學術領域包括計算機軟件理論、程序設計方法學、程序設計語言和符號計算。已出版多部著作和譯著,包括《程序設計語言基礎》(譯著,1990),《Mathematica數學軟件系統的應用與程序設計》(1994),《從問題到程序——程序設計與C語言引論》(1999)
[同作者作品]
計算機基礎教程(上下)(文科類)(裘宗燕等)
數據結構——C++與面向對象的途徑
數據結構--C++與面向對象的途徑(修訂版)
目錄
出版者的話
專家指導委員會
中文版序
譯者序
序
第2版序
第1版序
導 論
第1章 致讀者 3
1.1 本書的結構 3
1.1.1 例子和參考 4
1.1.2 練習 5
1.1.3 有關實現的注記 5
1.2 學習c++ 6
1.3 c++ 的設計 7
1.3.1 效率和結構 8
1.3.2 哲學注記 9
1.4 歷史注記 9
1.5 c++ 的使用 11
1.6 c和c++ 12
.1.6.1 給c程序員的建議 13
1.6.2 給c++程序員的建議 13
1.7 有關在c++里編程的思考 14
1.8 忠告 15
1.9 參考文獻 16
第2章 c++概覽 19
2.1 為什么是c++ 19
2.2 程序設計范型 19
2.3 過程式程序設計 20
2.3.1 變量和算術 21
2.3.2 檢測和循環 22
2.3.3 指針和數組 23
2.4 模塊程序設計 23
2.4.1 分別編譯 24
2.4.2 異常處理 25
2.5 數據抽象 26
2.5.1 定義類型的模塊 27
2.5.2 用戶定義類型 28
2.5.3 具體類型 29
2.5.4 抽象類型 31
2.5.
代碼片段和文件信息
/*?Code?for?exercise?10.12.
?|?
?|?“C++?Solutions--Companion?to?The?C++?Programming?Language?Third?Edition“
?|?by?David?Vandevoorde;?Addison-Wesley?1998;?ISBN?0-201-30965-3.
?|
?|?Permission?to?use?copy?modify?distribute?and?sell?this?software
?|?and?its?documentation?for?any?purpose?is?hereby?granted?without?fee.
?|?The?author?makes?no?representations?about?the?suitability?of?this
?|?software?for?any?purpose.??It?is?provided?“as?is“?without?express?or
?|?implied?warranty.
?‘----------------------------------------------------------------------*/
#include?
#include?
/*?The?following?can?go?in?a?header?file?*/
#include?
#include?
struct?Char_queue?{
???inline?Char_queue(unsigned?capacity?=?default_capacity);
???~Char_queue()?{?delete[]?queue_;?}
???bool?empty()?const?{?return?head_==tail_;?}
???inline?char?dequeue();
???inline?void?enqueue(char);
???bool?full()?const?{?return?head_==(tail_+1)%capacity_;?}
???static?bool?const?fixed_capacity?=?true;
private:
???static?unsigned?const?default_capacity?=?32;
???char?*queue_;
???unsigned?head_?tail_;
???unsigned?const?capacity_;
};
inline
Char_queue::Char_queue(unsigned?n)
???:?queue_(new?char[n+1])?head_(0)?tail_(0)?capacity_(n+1)?{
}
inline
char?Char_queue::dequeue()?{
???if?(!empty())?{
??????char?c?=?queue_[head_];
??????head_?=?(head_+1)%capacity_;
??????return?c;
???}?else
??????throw?std::underflow_error(std::string(“queue“));
}
inline
void?Char_queue::enqueue(char?c)?{
???if?(!full())?{
??????queue_[tail_]?=?c;
??????tail_?=?(tail_+1)%capacity_;
???}?else
??????throw?std::overflow_error(std::string(“queue“));
}
/*?Header?file?would?stop?here.?*/
/*?A?brief?test?of?the?above?implementation:?*/
int?main()?{
???Char_queue?q(4);
???while?(1)?{
??????if?(q.empty())?{?std::cout?<“Queue?is?empty.\n“;?}
??????else?if?(q.full())?{?std::cout?<“Queue?is?full.\n“;?}
??????char?cmd?ch;
??????std::cin?>>?cmd;
??????try?{
?????????switch?(cmd)?{
?????????case?‘e‘:?case?‘E‘:
????????????std::cin?>>?ch;
????????????q.enqueue(ch);
????????????break;
?????????case?‘d‘:?case?‘D‘:
????????????std::cout?<“Dequeued?“?<????????????break;
?????????case?‘q‘:?case?‘Q‘:
????????????std::cout?<“Quitting!\n“;
????????????return?0;
?????????default:
????????????std::cerr?<“Invalid?command!\n“;
?????????}
??????}?catch?(std::exception?&x)?{
?????????std::cerr?<“Caught?exception?“?<???????????????????<“?(“?<??????}
???}
???return?0;
}
- 上一篇:Android理財通助手源碼
- 下一篇:計算機專業畢業論文-網上訂餐系統
評論
共有 條評論