├── .gitignore ├── .latexmkrc ├── Makefile ├── README.md ├── beamercolorthemenwafusidebar.sty ├── beamerfontthemenwafusidebar.sty ├── beamerinnerthemenwafusidebar.sty ├── beamerouterthemenwafusidebar.sty ├── beamerthemenwafusidebar.sty ├── codes ├── ans4oj │ ├── 2019Ans4CIECPPOJ.zip │ ├── ans4cppoj.workspace │ ├── ans4cppoj.workspace.layout │ ├── ex1376-getEarning │ │ ├── ex1376-getEarning.cbp │ │ ├── ex1376-getEarning.depend │ │ ├── ex1376-getEarning.layout │ │ └── main.cpp │ ├── ex1377-reference │ │ ├── ex1377-reference.cbp │ │ ├── ex1377-reference.layout │ │ └── main.cpp │ ├── ex1378-defaultArg │ │ ├── ex1378-defaultArg.cbp │ │ ├── ex1378-defaultArg.layout │ │ └── main.cpp │ ├── ex1379-classStatic │ │ ├── ex1379-classStatic.cbp │ │ ├── ex1379-classStatic.layout │ │ └── main.cpp │ ├── ex1380-classDeepCopy │ │ ├── ex1380-classDeepCopy.cbp │ │ ├── ex1380-classDeepCopy.depend │ │ ├── ex1380-classDeepCopy.layout │ │ └── main.cpp │ ├── ex1381-classVirtualBase │ │ ├── ex1381-classVirtualBase.cbp │ │ ├── ex1381-classVirtualBase.layout │ │ └── main.cpp │ ├── ex1382-classHasa │ │ ├── ex1382-classHasa.cbp │ │ ├── ex1382-classHasa.layout │ │ └── main.cpp │ ├── ex1383-classDerive-List │ │ ├── ex1383-classDerive-List.cbp │ │ ├── ex1383-classDerive-List.depend │ │ ├── ex1383-classDerive-List.layout │ │ └── main.cpp │ ├── ex1383-classDeriveSTLlist │ │ ├── ex1383-classDeriveSTLlist.cbp │ │ ├── ex1383-classDeriveSTLlist.layout │ │ └── main.cpp │ ├── ex1383-classDeriveSTLstack-queue │ │ ├── ex1383-classDeriveSTLstack-queue.cbp │ │ ├── ex1383-classDeriveSTLstack-queue.layout │ │ └── main.cpp │ ├── ex1384-abstracClassOperatorOveride │ │ ├── ex1384-abstracClassOperatorOveride.cbp │ │ ├── ex1384-abstracClassOperatorOveride.layout │ │ └── main.cpp │ ├── ex1385-virtualFunction │ │ ├── ex1385-virtualFunction.cbp │ │ ├── ex1385-virtualFunction.depend │ │ ├── ex1385-virtualFunction.layout │ │ └── main.cpp │ └── ex1386-operatorOveride │ │ ├── ex1386-operatorOveride.cbp │ │ ├── ex1386-operatorOveride.layout │ │ └── main.cpp ├── chap01 │ ├── ex01-01.cpp │ └── ex01-02.cpp ├── chap02 │ ├── ex02-01.cpp │ ├── ex02-02.cpp │ ├── ex02-03.cpp │ ├── ex02-04.cpp │ ├── ex02-05.cpp │ ├── ex02-06.cpp │ ├── ex02-07.cpp │ ├── ex02-08.cpp │ ├── ex02-09.cpp │ ├── ex02-10.cpp │ ├── ex02-11.cpp │ ├── ex02-12.cpp │ ├── ex02-13.cpp │ ├── ex02-14.cpp │ ├── ex02-15.cpp │ ├── ex02-16.cpp │ ├── ex02-17.cpp │ ├── ex02-18.cpp │ ├── ex02-19-00 (复件).cpp │ ├── ex02-19-00.cpp │ ├── ex02-19-01.cpp │ ├── ex02-19-02.cpp │ ├── ex02-20-01.cpp │ ├── ex02-20-02.cpp │ ├── ex02-21.cpp │ ├── ex02-22.cpp │ ├── ex02-23-01.cpp │ ├── ex02-23-02.cpp │ ├── ex02-24.cpp │ ├── ex02-25-01.cpp │ ├── ex02-25-02.h │ ├── ex02-25.cpp │ ├── ex02-26-01.cpp │ └── ex02-26-02.h ├── chap03 │ ├── HandleClass.zip │ ├── ShapeArt.zip │ ├── ctor │ │ ├── copyctor.cpp │ │ └── stash.cpp │ ├── ex03-01.cpp │ ├── ex03-02.cpp │ ├── ex03-03-01.cpp │ ├── ex03-03-02.cpp │ ├── ex03-03.cpp │ ├── ex03-04.cpp │ ├── ex03-05.cpp │ ├── ex03-06.cpp │ ├── ex03-07.cpp │ ├── ex03-08.cpp │ ├── ex03-09.cpp │ ├── ex03-10.cpp │ ├── ex03-11.cpp │ ├── ex03-12.cpp │ ├── ex03-13.cpp │ ├── ex03-14.cpp │ ├── ex03-15.cpp │ ├── ex03-16.cpp │ ├── ex03-17.cpp │ ├── ex03-18.cpp │ ├── ex03-19.cpp │ ├── ex03-20.cpp │ ├── ex03-21.cpp │ ├── ex03-22.cpp │ ├── ex03-23.cpp │ ├── ex03-24.cpp │ ├── ex03-25-01.cpp │ ├── ex03-25.cpp │ ├── ex03-26.cpp │ ├── ex03-27.cpp │ ├── ex03-28.cpp │ ├── ex03-29.cpp │ ├── ex03-30.cpp │ ├── ex03-31.cpp │ ├── ex03-32.cpp │ ├── ex03-33-01.cpp │ ├── ex03-33-02.cpp │ ├── ex03-34.cpp │ ├── ex03-35.cpp │ ├── ex03-36-main.cpp │ ├── ex03-36-point.cpp │ ├── ex03-36-point.h │ ├── ex03-36-rectangle.cpp │ ├── ex03-36-rectangle.h │ ├── ex03-37-01-01.cpp │ ├── ex03-37-01-02.cpp │ ├── ex03-37-01.cpp │ ├── ex03-37-class.cpp │ ├── ex03-37-main.cpp │ ├── ex03-38-01-01.cpp │ ├── ex03-38-01-02.cpp │ ├── ex03-38-01.cpp │ ├── ex03-38-02-01.cpp │ ├── ex03-38-02-02.cpp │ ├── ex03-38-02.cpp │ ├── ex03-38.cpp │ ├── ex03-39.cpp │ ├── ex03-40.cpp │ ├── ex03-41-main.cpp │ ├── ex03-41-point2d.h │ ├── ex03-42.cpp │ ├── ex03-43.cpp │ ├── ex03-44-Point2D.cpp │ ├── ex03-44-Recrangle.cpp │ ├── ex03-45-Point2D.cpp │ ├── ex03-46.cpp │ ├── ex03-47-Point2D.cpp │ ├── ex03-47-main.cpp │ ├── ex03-48-constattr.cpp │ ├── ex03-49-constfun.cpp │ ├── ex03-49-main.cpp │ ├── ex03-50-constfun.cpp │ ├── ex03-51-01.cpp │ ├── ex03-51-constfun .cpp │ ├── ex03-51-constfun.cpp │ ├── ex03-51-main.cpp │ ├── ex03-52-main.cpp │ ├── ex03-52-mem.cpp │ ├── ex03-52-objmem.cpp │ ├── ex03-53-ctor-main.cpp │ ├── ex03-53-ctorseq.cpp │ ├── graph2d-leopard-circles.zip │ ├── handle.cpp │ ├── handle.h │ ├── leopard-circles-class.zip │ ├── leopard-circles-multifiles.zip │ └── this │ │ └── thisptr.cpp ├── chap04 │ ├── MatrixClass.zip │ ├── Rect-Point-Matrix.zip │ ├── ex04-01-01-CLocation.cpp │ ├── ex04-01-02-main.cpp │ ├── ex04-02-01-CLocation.cpp │ ├── ex04-02-02-main.cpp │ ├── ex04-03-01-PrePost.cpp │ ├── ex04-03-02-main.cpp │ ├── ex04-04-friendop.cpp │ ├── ex04-05-01-friendop.cpp │ ├── ex04-05-02-main.cpp │ ├── ex04-06-01-io.cpp │ ├── ex04-06-02-main.cpp │ ├── ex04-07-01-index.cpp │ ├── ex04-07-02-main.cpp │ ├── ex04-08-01-fun.cpp │ └── ex04-08-02-main.cpp ├── chap05 │ ├── 01ShapeClass │ │ ├── Donet.cpp │ │ ├── Donet.h │ │ ├── Ellipse.cpp │ │ ├── Ellipse.h │ │ ├── Point2D.cpp │ │ ├── Point2D.h │ │ ├── Rectangle.cpp │ │ ├── Rectangle.h │ │ ├── Shape.cpp │ │ ├── Shape.h │ │ ├── ShapeClass.cbp │ │ ├── ShapeClass.depend │ │ ├── ShapeClass.layout │ │ └── main.cpp │ ├── 02ShapeClass-DerivedType │ │ ├── Donet.cpp │ │ ├── Donet.h │ │ ├── Ellipse.cpp │ │ ├── Ellipse.h │ │ ├── Point2D.cpp │ │ ├── Point2D.h │ │ ├── Shape.cpp │ │ ├── Shape.h │ │ ├── ShapeClass.cbp │ │ ├── ShapeClass.depend │ │ ├── ShapeClass.layout │ │ └── main.cpp │ ├── 03testCtorDtor │ │ ├── base.h │ │ ├── derived.h │ │ ├── main.cpp │ │ ├── memobj.h │ │ ├── testCtorDtor.cbp │ │ ├── testCtorDtor.depend │ │ └── testCtorDtor.layout │ ├── 04testToBaseFun │ │ ├── main.cpp │ │ ├── testToBaseFun.cbp │ │ └── testToBaseFun.layout │ ├── 05-01Point2D.h │ ├── 05-02Shape.h │ ├── 05-03Rectangle.h │ ├── 05-04Ellipse.h │ ├── 05-05Donut.h │ ├── 05-06Rectangle.cpp │ ├── 05-07ShowPosFun.cpp │ ├── 05-08init-01.cpp │ ├── 05-08init-02.cpp │ ├── 05-08init-03.cpp │ ├── 05-08init-04.cpp │ ├── 05-09basecls.cpp │ ├── 05-09inheritcls.cpp │ ├── 05-09maincls.cpp │ ├── 05-10multibase.cpp │ ├── 05-10multibasectormain.cpp │ ├── 05-11CAnimal.cpp │ ├── 05-11CBird.cpp │ ├── 05-11CHorse.cpp │ ├── 05-11CPegasus.cpp │ ├── 05multiBase │ │ ├── main.cpp │ │ ├── multiBase.cbp │ │ └── multiBase.layout │ ├── 06multiBaseCtor │ │ ├── main.cpp │ │ ├── multiBaseCtor.cbp │ │ ├── multiBaseCtor.depend │ │ └── multiBaseCtor.layout │ ├── 07multiBasepegasus │ │ ├── Animal.cpp │ │ ├── Animal.h │ │ ├── Bird.cpp │ │ ├── Bird.h │ │ ├── Horse.cpp │ │ ├── Horse.h │ │ ├── Pegasus.cpp │ │ ├── Pegasus.h │ │ ├── main.cpp │ │ ├── multiBasepegasus.cbp │ │ ├── multiBasepegasus.depend │ │ └── multiBasepegasus.layout │ ├── 08testusingkeyword │ │ ├── testInheritingBaseClassCtor │ │ │ ├── main.cpp │ │ │ ├── testInheritingBaseClassCtor.cbp │ │ │ ├── testInheritingBaseClassCtor.depend │ │ │ └── testInheritingBaseClassCtor.layout │ │ ├── testUsingInDerivedAccessType │ │ │ ├── main.cpp │ │ │ ├── testUsingInDerivedAccessType.cbp │ │ │ └── testUsingInDerivedAccessType.layout │ │ └── testUsingOverloadInDerived │ │ │ ├── main.cpp │ │ │ ├── testUsingOverloadInDerived.cbp │ │ │ └── testUsingOverloadInDerived.layout │ └── 0XShapeClass │ │ ├── 05-11multiambiguous.cpp │ │ ├── 08-ambiguous.cpp │ │ ├── Donet.cpp │ │ ├── Donet.h │ │ ├── Ellipse.cpp │ │ ├── Ellipse.h │ │ ├── Point2D.cpp │ │ ├── Point2D.h │ │ ├── Rectangle.cpp │ │ ├── Rectangle.h │ │ ├── Shape.cpp │ │ ├── Shape.h │ │ ├── c5-11multiambiguous.cpp │ │ ├── c5-ambiguous.cpp │ │ ├── c5aShapeClass.cbp │ │ ├── c5aShapeClass.depend │ │ ├── c5aShapeClass.layout │ │ ├── c5aShapeClass.rar │ │ ├── c5aShapeClass │ │ ├── Donet.cpp │ │ ├── Donet.h │ │ ├── Ellipse.cpp │ │ ├── Ellipse.h │ │ ├── Point2D.cpp │ │ ├── Point2D.h │ │ ├── Rectangle.cpp │ │ ├── Rectangle.h │ │ ├── Shape.cpp │ │ ├── Shape.h │ │ ├── c5aShapeClass.cbp │ │ ├── c5aShapeClass.depend │ │ ├── c5aShapeClass.layout │ │ └── main.cpp │ │ ├── c5multibase.cpp │ │ ├── c5multibasector.cpp │ │ ├── c5virtualbase.cpp │ │ ├── c6multibasector.cpp │ │ ├── c7virtualbase.cpp │ │ └── main.cpp ├── chap06 │ ├── 01-zoo-CAnimal.cpp │ ├── 01-zoo-CBird.cpp │ ├── 01-zoo-CBull.cpp │ ├── 01-zoo-CHorse.cpp │ ├── 01-zoo-CPegasus.cpp │ ├── 01-zoo-main.cpp │ ├── 02-zoo-show.cpp │ ├── 02-zoo-talk.cpp │ ├── 02-zoo.cpp │ ├── 03-zoo-class.cpp │ ├── 03-zoo-show-talk.cpp │ ├── 04-zoo-main.cpp │ ├── 04-zoo-virtfun-show.cpp │ ├── 04-zoo-virtfun-talk.cpp │ ├── 05-dtor-base.cpp │ ├── 05-dtor-derived.cpp │ ├── 05-dtor-main.cpp │ ├── 06-vdtor-base.cpp │ ├── 07-abstract-main.cpp │ ├── 08-abstract-Shape.h │ ├── 08-abstract-ShapeArr.cpp │ ├── 08-abstract-ShapeArr.h │ ├── 08-abstract-data.cpp │ ├── 08-abstract-dtor.cpp │ ├── 09-rtti-class.cpp │ ├── 09-rtti-fun.cpp │ ├── 09-rtti-main.cpp │ ├── CB-Project-Codes │ │ ├── 01zoo-2017-withoutCZoo │ │ │ ├── Animal.cpp │ │ │ ├── Animal.h │ │ │ ├── Bird.cpp │ │ │ ├── Bird.h │ │ │ ├── Bull.cpp │ │ │ ├── Bull.h │ │ │ ├── Horse.cpp │ │ │ ├── Horse.h │ │ │ ├── Pegasus.cpp │ │ │ ├── Pegasus.h │ │ │ ├── Sound │ │ │ │ ├── Bull.wav │ │ │ │ ├── Eagle.wav │ │ │ │ └── Horse.wav │ │ │ ├── main.cpp │ │ │ ├── zoo.cbp │ │ │ ├── zoo.depend │ │ │ └── zoo.layout │ │ ├── 02zoo-2017-withCZoo │ │ │ ├── Animal.cpp │ │ │ ├── Animal.h │ │ │ ├── Bird.cpp │ │ │ ├── Bird.h │ │ │ ├── Bull.cpp │ │ │ ├── Bull.h │ │ │ ├── Horse.cpp │ │ │ ├── Horse.h │ │ │ ├── Pegasus.cpp │ │ │ ├── Pegasus.h │ │ │ ├── Sound │ │ │ │ ├── Bull.wav │ │ │ │ ├── Eagle.wav │ │ │ │ └── Horse.wav │ │ │ ├── Zoo.cpp │ │ │ ├── Zoo.h │ │ │ ├── main.cpp │ │ │ ├── zoo.cbp │ │ │ ├── zoo.depend │ │ │ └── zoo.layout │ │ ├── 03zoo-2017-withCZooBasePointer │ │ │ ├── Animal.cpp │ │ │ ├── Animal.h │ │ │ ├── Bird.cpp │ │ │ ├── Bird.h │ │ │ ├── Bull.cpp │ │ │ ├── Bull.h │ │ │ ├── Horse.cpp │ │ │ ├── Horse.h │ │ │ ├── Pegasus.cpp │ │ │ ├── Pegasus.h │ │ │ ├── Sound │ │ │ │ ├── Bull.wav │ │ │ │ ├── Eagle.wav │ │ │ │ └── Horse.wav │ │ │ ├── Zoo.cpp │ │ │ ├── Zoo.h │ │ │ ├── main.cpp │ │ │ ├── zoo.cbp │ │ │ ├── zoo.depend │ │ │ └── zoo.layout │ │ ├── 04zoo-2017-withVirtualFun │ │ │ ├── Animal.cpp │ │ │ ├── Animal.h │ │ │ ├── Bird.cpp │ │ │ ├── Bird.h │ │ │ ├── Bull.cpp │ │ │ ├── Bull.h │ │ │ ├── Horse.cpp │ │ │ ├── Horse.h │ │ │ ├── Pegasus.cpp │ │ │ ├── Pegasus.h │ │ │ ├── Sound │ │ │ │ ├── Bull.wav │ │ │ │ ├── Eagle.wav │ │ │ │ └── Horse.wav │ │ │ ├── Zoo.cpp │ │ │ ├── Zoo.h │ │ │ ├── main.cpp │ │ │ ├── zoo.cbp │ │ │ ├── zoo.depend │ │ │ └── zoo.layout │ │ ├── 05vitualDtor │ │ │ ├── main.cpp │ │ │ ├── vitualDtor.cbp │ │ │ └── vitualDtor.layout │ │ ├── 07DonutHouse-virtualFun │ │ │ ├── Donut.cpp │ │ │ ├── Donut.h │ │ │ ├── Ellipse.cpp │ │ │ ├── Ellipse.h │ │ │ ├── GlutBasic.cbp │ │ │ ├── GlutBasic.depend │ │ │ ├── GlutBasic.layout │ │ │ ├── Point2D.cpp │ │ │ ├── Point2D.h │ │ │ ├── Rectangle.cpp │ │ │ ├── Rectangle.h │ │ │ ├── Shape.cpp │ │ │ ├── Shape.h │ │ │ ├── ShapeArr.cpp │ │ │ ├── ShapeArr.h │ │ │ ├── Triangle.cpp │ │ │ ├── Triangle.h │ │ │ └── main.cpp │ │ └── zoosound │ │ │ ├── Bull.wav │ │ │ ├── Eagle.wav │ │ │ └── Horse.wav │ └── wholecode │ │ ├── 01zoo-2017-withoutCZoo │ │ ├── Animal.cpp │ │ ├── Animal.h │ │ ├── Bird.cpp │ │ ├── Bird.h │ │ ├── Bull.cpp │ │ ├── Bull.h │ │ ├── Horse.cpp │ │ ├── Horse.h │ │ ├── Pegasus.cpp │ │ ├── Pegasus.h │ │ ├── Sound │ │ │ ├── Bull.wav │ │ │ ├── Eagle.wav │ │ │ └── Horse.wav │ │ ├── main.cpp │ │ ├── zoo.cbp │ │ ├── zoo.depend │ │ └── zoo.layout │ │ ├── 01zoov01.cpp │ │ ├── 01zoov03.cpp │ │ ├── 01zoov04.cpp │ │ ├── 02zoo-2017-withCZoo │ │ ├── Animal.cpp │ │ ├── Animal.h │ │ ├── Bird.cpp │ │ ├── Bird.h │ │ ├── Bull.cpp │ │ ├── Bull.h │ │ ├── Horse.cpp │ │ ├── Horse.h │ │ ├── Pegasus.cpp │ │ ├── Pegasus.h │ │ ├── Sound │ │ │ ├── Bull.wav │ │ │ ├── Eagle.wav │ │ │ └── Horse.wav │ │ ├── Zoo.cpp │ │ ├── Zoo.h │ │ ├── main.cpp │ │ ├── zoo.cbp │ │ ├── zoo.depend │ │ └── zoo.layout │ │ ├── 03zoo-2017-withCZooBasePointer │ │ ├── Animal.cpp │ │ ├── Animal.h │ │ ├── Bird.cpp │ │ ├── Bird.h │ │ ├── Bull.cpp │ │ ├── Bull.h │ │ ├── Horse.cpp │ │ ├── Horse.h │ │ ├── Pegasus.cpp │ │ ├── Pegasus.h │ │ ├── Sound │ │ │ ├── Bull.wav │ │ │ ├── Eagle.wav │ │ │ └── Horse.wav │ │ ├── Zoo.cpp │ │ ├── Zoo.h │ │ ├── main.cpp │ │ ├── zoo.cbp │ │ ├── zoo.depend │ │ └── zoo.layout │ │ ├── 04zoo-2017-withVirtualFun │ │ ├── Animal.cpp │ │ ├── Animal.h │ │ ├── Bird.cpp │ │ ├── Bird.h │ │ ├── Bull.cpp │ │ ├── Bull.h │ │ ├── Horse.cpp │ │ ├── Horse.h │ │ ├── Pegasus.cpp │ │ ├── Pegasus.h │ │ ├── Sound │ │ │ ├── Bull.wav │ │ │ ├── Eagle.wav │ │ │ └── Horse.wav │ │ ├── Zoo.cpp │ │ ├── Zoo.h │ │ ├── main.cpp │ │ ├── zoo.cbp │ │ ├── zoo.depend │ │ └── zoo.layout │ │ ├── 05dtor.cpp │ │ ├── 05vitualDtor │ │ ├── main.cpp │ │ ├── vitualDtor.cbp │ │ └── vitualDtor.layout │ │ ├── 06zoo-2017-withPureVirtualFun │ │ ├── Animal.cpp │ │ ├── Animal.h │ │ ├── Bird.cpp │ │ ├── Bird.h │ │ ├── Bull.cpp │ │ ├── Bull.h │ │ ├── Horse.cpp │ │ ├── Horse.h │ │ ├── Pegasus.cpp │ │ ├── Pegasus.h │ │ ├── Sound │ │ │ ├── Bull.wav │ │ │ ├── Eagle.wav │ │ │ └── Horse.wav │ │ ├── Zoo.cpp │ │ ├── Zoo.h │ │ ├── main.cpp │ │ ├── zoo.cbp │ │ ├── zoo.depend │ │ └── zoo.layout │ │ ├── 07DonutHouse-virtualFun │ │ ├── Donut.cpp │ │ ├── Donut.h │ │ ├── Ellipse.cpp │ │ ├── Ellipse.h │ │ ├── GlutBasic.cbp │ │ ├── GlutBasic.depend │ │ ├── GlutBasic.layout │ │ ├── Point2D.cpp │ │ ├── Point2D.h │ │ ├── Rectangle.cpp │ │ ├── Rectangle.h │ │ ├── Shape.cpp │ │ ├── Shape.h │ │ ├── ShapeArr.cpp │ │ ├── ShapeArr.h │ │ ├── Triangle.cpp │ │ ├── Triangle.h │ │ └── main.cpp │ │ ├── 07abstractdtor.cpp │ │ ├── 09rtti.cpp │ │ └── zoosound │ │ ├── Bull.wav │ │ ├── Eagle.wav │ │ └── Horse.wav ├── chap07 │ ├── 01-funtemplate.cpp │ ├── 02-classtemplate.cpp │ ├── 03-operatortemplate.cpp │ ├── 04-operatortemplate.cpp │ ├── 05-templateob1.cpp │ ├── 05-templateob2.cpp │ ├── 06-main.cpp │ ├── 07-templatedefault-main.cpp │ ├── 07-templatedefault.cpp │ ├── 08-stack-class.cpp │ ├── 08-stack-fun-pop.cpp │ ├── 08-stack-fun-push.cpp │ ├── 08-stack-main.cpp │ ├── 09-vector01.cpp │ ├── 09-vector02.cpp │ ├── 10-list01.cpp │ ├── 11-list02.cpp │ ├── 12-deque01.cpp │ ├── 13-deque02.cpp │ ├── 14-iterator01.cpp │ ├── 15-itertempfind.cpp │ ├── 15-itertempmain.cpp │ ├── 15-itertempprint.cpp │ ├── 16-find.cpp │ ├── 16-findexample.cpp │ ├── 17-foreach.cpp │ ├── 17-foreachexample.cpp │ ├── 18-counterif.cpp │ ├── 19-replace.cpp │ ├── 20-remove.cpp │ ├── 21-sort.cpp │ ├── 22-sort2.cpp │ ├── 23-heap.cpp │ ├── 24-bisearch (复件).cpp │ ├── 24-bisearch.cpp │ ├── 25-set_intersection.cpp │ ├── 26-max.cpp │ ├── 27-funobj.cpp │ ├── 27-funobjmain01.cpp │ ├── 27-funobjmain02.cpp │ ├── 28-funobj.cpp │ ├── 28-funobjmain01.cpp │ ├── 29-funobjplus.cpp │ ├── 30-funobjgreater.cpp │ ├── 31-funobjlogicalnot.cpp │ ├── CB-Projector-Codes │ │ ├── Letc07.workspace │ │ ├── Letc07.workspace.layout │ │ ├── ex-src.zip │ │ ├── testExportCompile │ │ │ ├── main.cpp │ │ │ ├── safearray.cpp │ │ │ ├── safearray.h │ │ │ ├── testExportCompile.cbp │ │ │ ├── testExportCompile.depend │ │ │ └── testExportCompile.layout │ │ ├── testFunTemplate │ │ │ ├── main.cpp │ │ │ ├── testFunTemplate.cbp │ │ │ └── testFunTemplate.layout │ │ ├── testSTLALgFind │ │ │ ├── main.cpp │ │ │ ├── testSTLALgFind.cbp │ │ │ └── testSTLALgFind.layout │ │ ├── testSTLAlgBiSearch │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgBiSearch.cbp │ │ │ ├── testSTLAlgBiSearch.depend │ │ │ └── testSTLAlgBiSearch.layout │ │ ├── testSTLAlgForeach │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgForeach.cbp │ │ │ └── testSTLAlgForeach.layout │ │ ├── testSTLAlgFunObj01 │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgFunObj.layout │ │ │ ├── testSTLAlgFunObj01.cbp │ │ │ └── testSTLAlgFunObj01.layout │ │ ├── testSTLAlgFunObj02 │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgFunObj02.cbp │ │ │ └── testSTLAlgFunObj02.layout │ │ ├── testSTLAlgFunObj03 │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgFunObj03.cbp │ │ │ └── testSTLAlgFunObj03.layout │ │ ├── testSTLAlgFunObjGreater │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgFunObjGreater.cbp │ │ │ └── testSTLAlgFunObjGreater.layout │ │ ├── testSTLAlgFunObjLogicalNot │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgFunObjLogicalNot.cbp │ │ │ └── testSTLAlgFunObjLogicalNot.layout │ │ ├── testSTLAlgFunObjPlus │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgFunObjPlus.cbp │ │ │ └── testSTLAlgFunObjPlus.layout │ │ ├── testSTLAlgMaxElement │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgMaxElement.cbp │ │ │ └── testSTLAlgMaxElement.layout │ │ ├── testSTLAlgRemove │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgRemove.cbp │ │ │ ├── testSTLAlgRemove.depend │ │ │ └── testSTLAlgRemove.layout │ │ ├── testSTLAlgReplace │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgReplace.cbp │ │ │ └── testSTLAlgReplace.layout │ │ ├── testSTLAlgSetIntersection │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgSetIntersection.cbp │ │ │ └── testSTLAlgSetIntersection.layout │ │ ├── testSTLAlgSort01 │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgSort01.cbp │ │ │ └── testSTLAlgSort01.layout │ │ ├── testSTLAlgSort02 │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgSort02.cbp │ │ │ ├── testSTLAlgSort02.depend │ │ │ └── testSTLAlgSort02.layout │ │ ├── testSTLAlgSortHeap │ │ │ ├── main.cpp │ │ │ ├── testSTLAlgSortHeap.cbp │ │ │ └── testSTLAlgSortHeap.layout │ │ ├── testSTLCountIf │ │ │ ├── main.cpp │ │ │ ├── testSTLCountIf.cbp │ │ │ └── testSTLCountIf.layout │ │ ├── testSTLDeque01 │ │ │ ├── main.cpp │ │ │ ├── testSTLDeque01.cbp │ │ │ └── testSTLDeque01.layout │ │ ├── testSTLDeque02 │ │ │ ├── main.cpp │ │ │ ├── testSTLDeque02.cbp │ │ │ └── testSTLDeque02.layout │ │ ├── testSTLIterTemplate │ │ │ ├── main.cpp │ │ │ ├── testSTLIterTemplate.cbp │ │ │ └── testSTLIterTemplate.layout │ │ ├── testSTLIterator │ │ │ ├── main.cpp │ │ │ ├── testSTLIterator.cbp │ │ │ └── testSTLIterator.layout │ │ ├── testSTLList01 │ │ │ ├── main.cpp │ │ │ ├── testSTLList01.cbp │ │ │ └── testSTLList01.layout │ │ ├── testSTLList02 │ │ │ ├── main.cpp │ │ │ ├── testSTLList02.cbp │ │ │ └── testSTLList02.layout │ │ ├── testSTLVector01 │ │ │ ├── main.cpp │ │ │ ├── testSTLVector01.cbp │ │ │ └── testSTLVector01.layout │ │ ├── testSTLVector02 │ │ │ ├── main.cpp │ │ │ ├── testSTLVector02.cbp │ │ │ └── testSTLVector02.layout │ │ ├── testSafeArray │ │ │ ├── main.cpp │ │ │ ├── testSafeArray.cbp │ │ │ └── testSafeArray.layout │ │ ├── testSafeArrayDefault │ │ │ ├── main.cpp │ │ │ ├── testSafeArrayDefault.cbp │ │ │ └── testSafeArrayDefault.layout │ │ ├── testSafeArrayFunTemplate │ │ │ ├── main.cpp │ │ │ ├── testSafeArrayFunTemplate.cbp │ │ │ ├── testSafeArrayFunTemplate.depend │ │ │ └── testSafeArrayFunTemplate.layout │ │ └── testStackTemplate │ │ │ ├── main.cpp │ │ │ ├── testStackTemplate.cbp │ │ │ └── testStackTemplate.layout │ └── code │ │ ├── 01-funtemplate.cpp │ │ ├── 02-classtemplate.cpp │ │ ├── 03-classtemplatesafetyarray.cpp │ │ ├── 04-stack.cpp │ │ ├── 05-vector01.cpp │ │ ├── 06-vector02.cpp │ │ ├── 07-list01.cpp │ │ ├── 08-list02.cpp │ │ ├── 09-deque01.cpp │ │ ├── 09-deque02.cpp │ │ ├── 10-iterator01.cpp │ │ ├── 11-iteratortemplate.cpp │ │ ├── 12-algorithm.cpp │ │ ├── 13-algfind.cpp │ │ ├── 14-foreachexample.cpp │ │ ├── 15-counterif.cpp │ │ ├── 19-replace.cpp │ │ ├── 20-remove.cpp │ │ ├── 23-heap.cpp │ │ ├── 24-bisearch.cpp │ │ ├── 25-set_intersection.cpp │ │ ├── 26-max.cpp │ │ ├── 27-funobj.cpp │ │ ├── 28-funobj.cpp │ │ ├── 29-funobjplus.cpp │ │ ├── 30-funobjgreater.cpp │ │ ├── 31-funobjlogicalnot.cpp │ │ └── chap07code.zip ├── chap08 │ ├── 01-fomat01.cpp │ ├── code │ │ └── 01-fomat01.cpp │ ├── testBiFileRead │ │ ├── main.cpp │ │ ├── record.bin │ │ ├── testBiFileRead.cbp │ │ └── testBiFileRead.layout │ ├── testFileMergin │ │ ├── main.cpp │ │ ├── testFileMergin.cbp │ │ ├── testFileMergin.depend │ │ └── testFileMergin.layout │ ├── testFileMerginSort │ │ ├── 01-structdef.cpp │ │ ├── 02-readfilefun.cpp │ │ ├── 03-printfilefun.cpp │ │ ├── 04-mainfun.cpp │ │ ├── first.txt │ │ ├── main.cpp │ │ ├── result.txt │ │ ├── second.txt │ │ ├── testFileMerginSort.cbp │ │ └── testFileMerginSort.layout │ ├── testFormat │ │ ├── main-main.cpp │ │ ├── main.cpp │ │ ├── testFormat.cbp │ │ └── testFormat.layout │ ├── testFormat02 │ │ ├── main.cpp │ │ ├── testFormat02.cbp │ │ └── testFormat02.layout │ ├── testGet │ │ ├── main.cpp │ │ ├── testGet.cbp │ │ └── testGet.layout │ ├── testGetline │ │ ├── main.cpp │ │ ├── testGetline.cbp │ │ └── testGetline.layout │ ├── testGetline02 │ │ ├── main.cpp │ │ ├── testGetline02.cbp │ │ └── testGetline02.layout │ ├── testIOFlag │ │ ├── main.cpp │ │ ├── testIOFlag.cbp │ │ ├── testIOFlag.depend │ │ └── testIOFlag.layout │ ├── testIOStream.workspace │ ├── testIOStream.workspace.layout │ ├── testImageReadWrite │ │ ├── 01-strucdef.cpp │ │ ├── 02-mainfun-01.cpp │ │ ├── 03-mainfun-02.cpp │ │ ├── Lighthouse.bmp │ │ ├── Penguins.bmp │ │ ├── Result.bmp │ │ ├── main (另一个复件).cpp │ │ ├── main.cpp │ │ ├── testImageReadWrite.cbp │ │ ├── testImageReadWrite.depend │ │ └── testImageReadWrite.layout │ ├── testTXTRead │ │ ├── main.cpp │ │ ├── record.txt │ │ ├── testTXTRead.cbp │ │ └── testTXTRead.layout │ ├── testTXTWrite │ │ ├── main.cpp │ │ ├── record.txt │ │ ├── testTXTWrite.cbp │ │ └── testTXTWrite.layout │ ├── testbiFileWrite │ │ ├── main.cpp │ │ ├── record.bin │ │ ├── testbiFileWrite.cbp │ │ └── testbiFileWrite.layout │ └── testcout01 │ │ ├── main.cpp │ │ ├── testcout01.cbp │ │ ├── testcout01.depend │ │ └── testcout01.layout ├── chap09 │ ├── testItoa │ │ ├── main.cpp │ │ ├── testItoa.cbp │ │ └── testItoa.layout │ ├── teststrAlgo │ │ ├── main.cpp │ │ ├── teststrAlgo.cbp │ │ └── teststrAlgo.layout │ ├── teststrAtoi │ │ ├── main (复件).cpp │ │ ├── main.cpp │ │ ├── main2.cpp │ │ ├── teststrAtoi.cbp │ │ └── teststrAtoi.layout │ ├── teststrGetWord │ │ ├── main.cpp │ │ ├── teststrGetWord.cbp │ │ └── teststrGetWord.layout │ ├── teststrOperator │ │ ├── main.cpp │ │ ├── teststrOperator.cbp │ │ └── teststrOperator.layout │ ├── teststrfindreplace │ │ ├── main.cpp │ │ ├── teststrfindreplace.cbp │ │ └── teststrfindreplace.layout │ ├── teststring.workspace │ ├── teststring.workspace.layout │ ├── teststring01 │ │ ├── main.cpp │ │ ├── teststring01.cbp │ │ └── teststring01.layout │ └── teststrreplace │ │ ├── main.cpp │ │ ├── teststrreplace.cbp │ │ ├── teststrreplace.depend │ │ └── teststrreplace.layout ├── chap10 │ ├── testTryCatch01 │ │ ├── 01-structdef.cpp │ │ ├── 02-mainfun.cpp │ │ ├── main.cpp │ │ ├── testTryCatch01.cbp │ │ └── testTryCatch01.layout │ ├── testexception.workspace │ ├── testexception.workspace.layout │ └── testfileexception │ │ ├── main.cpp │ │ ├── test.txt │ │ ├── testfileexception.cbp │ │ ├── testfileexception.depend │ │ └── testfileexception.layout └── covertutf8.sh ├── data ├── ch00.tex ├── ch01.tex ├── ch02.tex ├── ch03.tex ├── ch04.tex ├── ch05.tex ├── ch06.tex ├── ch07.tex ├── ch08.tex ├── ch09.tex ├── ch10-long.tex └── ch10.tex ├── demos ├── Lect00-Intro.pdf ├── Lect01-Base .pdf ├── Lect02-C2CPP.pdf ├── Lect03-Class.pdf ├── Lect04-OperatorOverload.pdf ├── Lect05-Inherit.pdf ├── Lect06-VirtualFun.pdf ├── Lect07-ClassTemplate-STL.pdf ├── Lect08-IO-Stream.pdf ├── Lect09-string-Class.pdf └── Lect10-exception try-catch.pdf ├── ex-src01.zip ├── ex-src02.zip ├── ex-src03.zip ├── ex-src04.zip ├── ex-src05.zip ├── ex-src06.zip ├── ex-src07.zip ├── ex-src08.zip ├── ex-src09.zip ├── ex-src10.zip ├── figure ├── chap00 │ ├── 01textbook.jpg │ ├── 02primerplus.jpg │ ├── 02primerpluszh.jpg │ ├── 02programming.jpg │ ├── 03programming.jpg │ ├── 04primerpluszh.jpg │ ├── CHTP.jpg │ ├── CHTP9e.jpg │ ├── PAinCPP.jpg │ ├── oopmindmap.pdf │ ├── studyscheme-tem.png │ └── studyscheme.pdf ├── chap01 │ ├── 01trees.png │ ├── 02treesgrow.png │ ├── 03treesseason.png │ ├── 04tetrogame.png │ ├── 05tetroobj.png │ ├── 06tetromove.png │ ├── 07abstraction01.png │ ├── 07abstraction02.png │ ├── 07abstraction03.png │ ├── 07abstraction04.jpg │ ├── 08encap01.jpg │ ├── 08encap02.jpg │ ├── 09inherit01.jpg │ ├── 09inherit02.jpg │ ├── 09inherit02.xcf │ ├── 10lispauthor.jpg │ ├── 11simulaauthor.png │ ├── 12smalltalkauthor.jpg │ ├── 13cauthor.jpg │ ├── 14cppauthor.jpg │ ├── 15javaauthor.png │ ├── 16cppauthor2.png │ ├── 17idedevc.png │ ├── 18idevs2005.png │ ├── 19idecb.png │ └── 20ideqt.png ├── chap02 │ ├── 01cppoutput01.png │ ├── 01cppoutput02.png │ ├── 02cast.pdf │ ├── 03funasm.pdf │ ├── 04inlinetest.png │ ├── 05externkeyword.png │ └── 06statickeyword.png ├── chap03 │ ├── 00graph2dcoord.png │ ├── 01graph2dcoord.png │ ├── 01thispointor.png │ ├── 02graph2dinstall.png │ ├── 03graph2dCBsetting.png │ ├── 04graph2d1stpic.png │ ├── 05graph2d2ndpic.png │ ├── 06objsmemaddr.png │ ├── 07ctorsequence.png │ ├── cppg2d.png │ ├── cppg2dwizard.png │ ├── freeglut.png │ └── leopard.png ├── chap04 │ ├── 01tiananmen.png │ └── 02nwsuaf.png ├── chap05 │ ├── 01MFC01.png │ ├── 01MFC02.png │ ├── 01MFC03.png │ ├── 01qt42classchart.pdf │ ├── 02qt42.pdf │ ├── 02qt43classchart.pdf │ ├── 03-01drawbox.jpg │ ├── 03-02linebox.jpg │ ├── 03-03shapebox.jpg │ ├── 03mfc.gif │ ├── 04shapefig.jpg │ ├── 05ctorinit.jpg │ ├── 06-01horse.jpg │ ├── 06-02bird.jpg │ ├── 06-03horsebird.jpg │ ├── 07-multiInheritCtor.jpg │ ├── 08-ambiguous.png │ ├── 09-ctor-ambiguous.png │ └── 10-virtualctor.png ├── chap06 │ ├── 01bird.jpg │ ├── 02horse.jpg │ ├── 03pegasus.jpg │ ├── 04bull.jpg │ ├── 05virtualfunerror.png │ ├── 06novdtor.png │ ├── 07vdtor.png │ ├── 08abstractobj.png │ ├── 09shapehouse.jpg │ └── 10rtti.png ├── chap07 │ ├── 01stack01.png │ ├── 01stack02.png │ ├── 02stl01.png │ ├── 02stl02.png │ ├── 02stl03.png │ ├── 02stl04.png │ ├── 03stl05.png │ ├── 04stl0container.png │ ├── 05stltimeO.png │ ├── 06queue.png │ ├── 07stack.png │ ├── 08iterator01.png │ ├── 08iterator2.png │ ├── 09stlsort.png │ ├── 10heap.png │ ├── 11tree.png │ └── 12boost.png ├── chap08 │ ├── 01inputdevice.png │ ├── 02mem.png │ ├── 03outputdevice.png │ ├── 04charset.png │ └── 05fomatflag.png ├── chap10 │ └── 01trycatchclass.png ├── nwsuaflogobar.png ├── nwsuaflogobk.png ├── nwsuaflogoc.pdf ├── nwsuaflogoc.png ├── pdfattatchdownload01.png ├── pdfattatchdownload02.png ├── pdfattatchdownload03.png └── pdfattatchdownload04.png ├── main.pdf ├── main.tex ├── nwafulogo ├── cir_bar_h_w.pdf ├── circle.pdf ├── h_bar.pdf ├── nwafu_logo_cie.png └── nwafu_waves.pdf ├── pgf-umlcd-gn.sty ├── screenshots ├── 00cover.png ├── 00cover2.png ├── 01withclock.png ├── 01withclock2.png ├── 02tikzfig.png ├── 02tikzfig2.png ├── 03UML.png └── 03UML2.png ├── settings ├── format.tex └── packages.tex ├── tdclock.sty └── tikz-flowchart.sty /.latexmkrc: -------------------------------------------------------------------------------- 1 | $pdflatex = 'xelatex -shell-escape -synctex=1 -interaction=nonstopmode %O %S'; 2 | $pdf_mode = 1; 3 | $postscript_mode = $dvi_mode = 0; 4 | $clean_ext = 'aux bbl equ glo gls hd idx ilg ind lof lot out blg log thm toc synctex.gz lofEN lotEN equEN etoc'; 5 | $makeindex = 'zhmakeindex -s gind.ist %O -o %D %S'; 6 | add_cus_dep('glo', 'gls', 0, 'makeglo2gls'); 7 | sub makeglo2gls { 8 | system("zhmakeindex -s gglo.ist -o \"$_[0].gls\" \"$_[0].glo\""); 9 | } 10 | -------------------------------------------------------------------------------- /codes/ans4oj/2019Ans4CIECPPOJ.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/ans4oj/2019Ans4CIECPPOJ.zip -------------------------------------------------------------------------------- /codes/ans4oj/ans4cppoj.workspace.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1376-getEarning/ex1376-getEarning.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1560211022 source:/home/registor/Desktop/testCPP/ans4oj/ex1376-getEarning/main.cpp 3 | 4 | 5 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1376-getEarning/ex1376-getEarning.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1377-reference/ex1377-reference.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1378-defaultArg/ex1378-defaultArg.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1379-classStatic/ex1379-classStatic.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1380-classDeepCopy/ex1380-classDeepCopy.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1560215182 source:/home/registor/Desktop/testCPP/ans4oj/ex1380-classDeepCopy/main.cpp 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1380-classDeepCopy/ex1380-classDeepCopy.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1381-classVirtualBase/ex1381-classVirtualBase.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1382-classHasa/ex1382-classHasa.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1383-classDerive-List/ex1383-classDerive-List.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1560260646 source:/home/registor/Desktop/testCPP/ans4oj/ex1383-classDerive-List/main.cpp 3 | 4 | 5 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1383-classDerive-List/ex1383-classDerive-List.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1383-classDeriveSTLlist/ex1383-classDeriveSTLlist.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1385-virtualFunction/ex1385-virtualFunction.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1560296606 source:/home/registor/Desktop/testCPP/ans4oj/ex1385-virtualFunction/main.cpp 3 | 4 | 5 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1385-virtualFunction/ex1385-virtualFunction.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/ans4oj/ex1386-operatorOveride/ex1386-operatorOveride.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap01/ex01-01.cpp: -------------------------------------------------------------------------------- 1 | // 例01-01:ex01-01.cpp 2 | #include 3 | using namespace std; 4 | int main( ) 5 | { 6 | char strName[32]; 7 | cin >> strName; 8 | cout << "Hello, " << strName << "!" << endl; 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /codes/chap02/ex02-01.cpp: -------------------------------------------------------------------------------- 1 | // 例02-01:ex02-01.cpp 2 | //求三个数的平均值,演示C++简单I/O 3 | #include 4 | using namespace std; 5 | int main( ) 6 | { 7 | float num1, num2, num3; //定义三个数 8 | 9 | cout << "Please input three numbers:" ; 10 | cin >> num1 >> num2 >> num3; 11 | 12 | cout << "The average of " << num1 << ", " << num2 << "and " << num3; 13 | cout << " is: " << (num1 + num2 + num3) / 3 << endl; 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /codes/chap02/ex02-03.cpp: -------------------------------------------------------------------------------- 1 | // 例02-03:ex02-03.cpp 2 | #include 3 | using namespace std; 4 | 5 | void swap(int &a, int &b) 6 | { 7 | int temp = a; 8 | a = b; 9 | b = temp; 10 | } 11 | 12 | int main() 13 | { 14 | int m = 3, n = 4; 15 | 16 | cout << "before swap:"; 17 | cout << m << "," << n < 3 | using namespace std; 4 | 5 | void swap(int *a, int *b) 6 | { 7 | int temp = *a; 8 | *a = *b; 9 | *b = temp; 10 | } 11 | 12 | int main() 13 | { 14 | int m = 3, n = 4; 15 | 16 | cout << "before swap:"; 17 | cout << m << "," << n << endl; 18 | 19 | swap(&m, &n); 20 | 21 | cout << "after swap:"; 22 | cout << m << "," << n << endl; 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /codes/chap02/ex02-05.cpp: -------------------------------------------------------------------------------- 1 | // 例02-05:ex02-05.cpp 2 | void CreateHeadNode(StuNode **pHead) 3 | { 4 | StuNode *p; 5 | p = new StuNode; 6 | if (p == NULL) return; 7 | p->next = NULL; 8 | *pHead = p; 9 | } 10 | 11 | int main() 12 | { 13 | StuNode *pHead = NULL; 14 | CreateHeadNode(&pHead); 15 | 16 | return 0; 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /codes/chap02/ex02-06.cpp: -------------------------------------------------------------------------------- 1 | // 例02-06:ex02-06.cpp 2 | void CreateHeadNode(StuNode *&pHead) 3 | { 4 | StuNode *p; 5 | p = new StuNode; 6 | if (p == NULL) return; 7 | p->next = NULL; 8 | pHead = p; 9 | } 10 | 11 | int main() 12 | { 13 | StuNode *pHead = NULL; 14 | CreateHeadNode(pHead); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /codes/chap02/ex02-12.cpp: -------------------------------------------------------------------------------- 1 | // 例02-12:ex02-12.cpp 2 | void SetNetCamera (char *UserName = "Guest", char *Password = "321", 3 | char *URL = "219.145.198.100", char *ServerName = "654", 4 | float Zoom, float Alpha, float Beta) 5 | { 6 | cout << UserName << " " << Password << " " 7 | << URL << " " << ServerName << " " 8 | << Zoom << " " << Alpha << " " << Beta << endl; 9 | } 10 | -------------------------------------------------------------------------------- /codes/chap02/ex02-13.cpp: -------------------------------------------------------------------------------- 1 | // 例02-13:ex02-13.cpp 2 | void SetNetCamera (char *UserName = "Guest", char *Password = "321", 3 | char *URL, char *ServerName, 4 | float Zoom = 0.2, float Alpha = 10.0, float Beta = 15.0) 5 | { 6 | cout << UserName << " " << Password << " " 7 | << URL << " " << ServerName << " " 8 | << Zoom << " " << Alpha << " " << Beta << endl; 9 | } 10 | -------------------------------------------------------------------------------- /codes/chap02/ex02-16.cpp: -------------------------------------------------------------------------------- 1 | // 例02-16:ex02-16.cpp 2 | template 3 | _T sum(_T *a, int size) 4 | { 5 | _T result = 0; 6 | for (int i = 0; i < size; i++) 7 | { 8 | result += a[i]; 9 | } 10 | return result; 11 | } 12 | -------------------------------------------------------------------------------- /codes/chap02/ex02-17.cpp: -------------------------------------------------------------------------------- 1 | // 例02-17:ex02-17.cpp 2 | template 3 | void myfunc(T1 x, T2 y) 4 | { 5 | cout << x << ' ' << y << endl; 6 | } 7 | 8 | int main() 9 | { 10 | myfunc(10, "I hate C++"); 11 | myfunc(98.6, 19L); 12 | } 13 | -------------------------------------------------------------------------------- /codes/chap02/ex02-18.cpp: -------------------------------------------------------------------------------- 1 | // 例02-18:ex02-18.cpp 2 | template 3 | void bubble(_T *items, int count) 4 | { 5 | register int a, b; 6 | _T t; 7 | for(a = 1; a < count; a++) 8 | for(b = count - 1; b >= a; b--) 9 | if(items[b - 1] > items[b]) 10 | { 11 | t = items[b - 1]; 12 | items[b - 1] = items[b]; 13 | tems[b] = t; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /codes/chap02/ex02-19-00 (复件).cpp: -------------------------------------------------------------------------------- 1 | //ex02-19-00.cpp 2 | #include 3 | using namespace std; 4 | extern void p1dispG(); 5 | extern void p2dispG(); 6 | extern void p2dispg(); 7 | int G = 0, g = 0; 8 | int main(){ 9 | p1dispG(); 10 | p2dispG(); 11 | p2dispg(); 12 | cout << "in p G=" << G << endl; 13 | cout << "in p g=" << g << endl; 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /codes/chap02/ex02-19-00.cpp: -------------------------------------------------------------------------------- 1 | // 例02-19-00:ex02-19-00.cpp 2 | #include 3 | using namespace std; 4 | extern void p1dispG(); 5 | extern void p2dispG(); 6 | extern void p2dispg(); 7 | int G = 0, g = 0; 8 | int main(){ 9 | p1dispG(); 10 | p2dispG(); 11 | p2dispg(); 12 | cout << "in p G=" << G << endl; 13 | cout << "in p g=" << g << endl; 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /codes/chap02/ex02-19-01.cpp: -------------------------------------------------------------------------------- 1 | // 例02-19-01:ex02-19-01.cpp 2 | #include 3 | using namespace std; 4 | extern int G; 5 | void p1dispG() 6 | { 7 | G = 11; 8 | cout << "in p1 G=" << G << endl; 9 | } 10 | -------------------------------------------------------------------------------- /codes/chap02/ex02-19-02.cpp: -------------------------------------------------------------------------------- 1 | // 例02-19-02:ex02-19-02.cpp 2 | #include 3 | using namespace std; 4 | extern int G; 5 | extern int g; 6 | void p2dispG(){ 7 | G = 22; 8 | cout << "in p2 G=" << G << endl; 9 | } 10 | void p2dispg(){ 11 | g = 33; 12 | cout << "in p2 g=" << g << endl; 13 | } 14 | -------------------------------------------------------------------------------- /codes/chap02/ex02-20-01.cpp: -------------------------------------------------------------------------------- 1 | // 例02-20-01:ex02-20-01.cpp 2 | extern void p1dispG(); 3 | static int G=0; 4 | 5 | int main() { 6 | p1dispG(); 7 | cout<<"in p G="< 3 | using namespace std; 4 | #include "Xilin.h" 5 | 6 | int main() 7 | { 8 | Xilin::ShowName(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /codes/chap02/ex02-26-02.h: -------------------------------------------------------------------------------- 1 | // 例02-26-02:ex02-26-02.cpp 2 | //Xilin.h 3 | #ifndef XILIN_H_INCLUDED 4 | #define XILIN_H_INCLUDED 5 | 6 | namespace Xilin 7 | { 8 | int year = 2011; 9 | char name[] = "Xilin"; 10 | void ShowName() 11 | { 12 | cout << name << " " << 13 | year << endl; 14 | } 15 | } 16 | 17 | #endif // XILIN_H_INCLUDED 18 | -------------------------------------------------------------------------------- /codes/chap03/HandleClass.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap03/HandleClass.zip -------------------------------------------------------------------------------- /codes/chap03/ShapeArt.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap03/ShapeArt.zip -------------------------------------------------------------------------------- /codes/chap03/ex03-01.cpp: -------------------------------------------------------------------------------- 1 | // 例03-01:ex03-01.cpp 2 | // 结构体定义及其中函数的实现 3 | 4 | struct StuNode 5 | { 6 | int ID; 7 | char name[20]; 8 | char gender[16]; 9 | int age; 10 | void Set(int id, char *n, char *g, int a); 11 | }; 12 | 13 | // 赋值函数,为结构体中的数据赋值 14 | void StuNode::Set(int id, char *n, char *g, int a) 15 | { 16 | ID = id; 17 | strcpy(name, n); 18 | strcpy(gender, g); 19 | age = a; 20 | } 21 | -------------------------------------------------------------------------------- /codes/chap03/ex03-02.cpp: -------------------------------------------------------------------------------- 1 | // 例03-02:ex03-02.cpp 2 | // 结构体的定义 3 | 4 | struct StuNode 5 | { 6 | int ID; 7 | char name[20]; 8 | char gender[16]; 9 | int age; 10 | 11 | // 结构体中的赋值函数 12 | void Set(int id, char *n, char *g, int a) 13 | { 14 | ID = id; 15 | strcpy(name, n); 16 | strcpy(gender, g); 17 | age = a; 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /codes/chap03/ex03-03-02.cpp: -------------------------------------------------------------------------------- 1 | // 例03-03-02:ex03-03-02.cpp 2 | 3 | myRect r = {10.0, 10.0, 4 | 200.0, 100.0}; 5 | 6 | void display() 7 | { 8 | r.Draw(); 9 | } 10 | 11 | void keyboard(unsigned char key) 12 | { 13 | r.Move(); 14 | } 15 | 16 | int main(int argc, char *argv[]) 17 | { 18 | initGraph(display, keyboard); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /codes/chap03/ex03-03.cpp: -------------------------------------------------------------------------------- 1 | // 例03-03:ex03-03.cpp 2 | 3 | struct StuNode 4 | { 5 | int ID; 6 | char name[20]; 7 | char gender[16]; 8 | int age; 9 | 10 | // 赋值函数,以同类型的对象为参数 11 | void Set(StuNode inNode) 12 | { 13 | ID = inNode.ID; 14 | strcpy(name, inNode.name); 15 | strcpy(gender, inNode.gender); 16 | age = inNode.age; 17 | } 18 | }; 19 | int main() 20 | { 21 | StuNode myNode0; 22 | } 23 | -------------------------------------------------------------------------------- /codes/chap03/ex03-05.cpp: -------------------------------------------------------------------------------- 1 | // 例03-05:ex03-05.cpp 2 | // 创建结构体 Stash 的实例, 3 | // 调用函数 addData 4 | 5 | int main() 6 | { 7 | Stash buff(NULL, 0); 8 | for (int i = 0; i < 100; i++) 9 | addData(buff, 100 - i); 10 | } 11 | -------------------------------------------------------------------------------- /codes/chap03/ex03-07.cpp: -------------------------------------------------------------------------------- 1 | // 例03-07:ex03-07.cpp 2 | // C 语言方式实现结构体 CStash 3 | // 的处理函数 add 4 | 5 | int add(CStash* s, int element) 6 | { 7 | // 检查 s.a 是否满了 8 | if(s->next >= s->size) 9 | // s.a 已无空间时, 10 | // 增加 increment 个单位 11 | inflate(s, increment); 12 | // 尾部加入元素 13 | s->a[s->next] = element; 14 | // 更新 next 值 15 | s->next++; 16 | 17 | return(s->next - 1); 18 | } 19 | -------------------------------------------------------------------------------- /codes/chap03/ex03-10.cpp: -------------------------------------------------------------------------------- 1 | // 例03-10:ex03-10.cpp 2 | // C++ 中类的定义(数据+处理函数的封装) 3 | 4 | const int increment = 5; 5 | 6 | class Stash 7 | { 8 | int size; // Number of a spaces 9 | int next; // Next empty space 10 | int *a;// Dynamically allocated arrays 11 | // Functions 12 | void initialize(); 13 | void cleanup(); 14 | int add(int element); 15 | int fetch(int index); 16 | int count(); 17 | void inflate(int increase); 18 | }; 19 | -------------------------------------------------------------------------------- /codes/chap03/ex03-11.cpp: -------------------------------------------------------------------------------- 1 | // 例03-11:ex03-11.cpp 2 | // 类中成员函数 add 的实现 3 | 4 | // 在 a 的尾部添加元素 element, 5 | // 若 a 中已无空间了,则调用 inflate 6 | // 函数增加 increment 个单位 7 | // 返回 a 中最后一个元素的 index 8 | int Stash::add(int element) 9 | { 10 | if(next >= size) 11 | inflate(increment); 12 | a[next] = element; 13 | next++; 14 | return(next - 1); 15 | } 16 | -------------------------------------------------------------------------------- /codes/chap03/ex03-12.cpp: -------------------------------------------------------------------------------- 1 | // 例03-12:ex03-12.cpp 2 | // 创建类 Stach 的对象,调用相关成员函数进行处理 3 | 4 | int main() 5 | { 6 | Stash s; 7 | 8 | s.initialize(); // 初始化 9 | 10 | for(int i = 0; i < 100; i++) 11 | s.add(100 - i); // 添加元素 12 | 13 | for(int j = 0; j < s.count(); j++) 14 | cout << "No." << j << " = " 15 | << s.fetch(j) << endl; // 输出元素 16 | 17 | s.cleanup(); 18 | } 19 | -------------------------------------------------------------------------------- /codes/chap03/ex03-13.cpp: -------------------------------------------------------------------------------- 1 | // 例03-13:ex03-13.cpp 2 | // 定义类 Stash,对其中成员(数据或函数) 3 | // 根据需要赋予不同的权限 4 | 5 | class Stash 6 | { 7 | private: 8 | int size; // Number of a spaces 9 | int next; // Next empty space 10 | int *a;// Dynamically allocated arrays 11 | void inflate(int increase); 12 | public: 13 | void initialize(); 14 | void cleanup(); 15 | int add(int element); 16 | int fetch(int index); 17 | int count(); 18 | }; 19 | -------------------------------------------------------------------------------- /codes/chap03/ex03-14.cpp: -------------------------------------------------------------------------------- 1 | // 例03-14:ex03-14.cpp 2 | // 数据成员为结构体类型的类 3 | 4 | struct Record 5 | { 6 | char name[20]; 7 | int score; 8 | }; 9 | class Team 10 | { 11 | private: 12 | int num; //基本类型 13 | Record *p; //构造类型 14 | }; 15 | -------------------------------------------------------------------------------- /codes/chap03/ex03-15.cpp: -------------------------------------------------------------------------------- 1 | // 例03-15:ex03-15.cpp 2 | // 关于类中数据成员定义为类类型的示例 3 | 4 | class Team; //已定义的类 5 | class Grade 6 | { 7 | Team a; // 已定义的类类型 8 | Grade *p; // 正在定义的类类型定义指针成员 9 | Grade &r; // 正在定义的类类型定义引用成员 10 | Grade b; // 错误! 使用了未定义完整的类 11 | }; 12 | -------------------------------------------------------------------------------- /codes/chap03/ex03-16.cpp: -------------------------------------------------------------------------------- 1 | // 例03-16:ex03-16.cpp 2 | // 类 Stash 成员函数 add 的实现 3 | 4 | // 在 a 的尾部添加元素 element,若 a 中已无空间,则调用 5 | // inflate函数增加 increment 个单位 6 | // 函数返回 a 中最后一个元素的 index 7 | 8 | int Stash::add(int element) 9 | { 10 | if(next >= size) 11 | inflate(increment); 12 | a[next] = element; 13 | next++; 14 | return (next - 1); 15 | } 16 | -------------------------------------------------------------------------------- /codes/chap03/ex03-18.cpp: -------------------------------------------------------------------------------- 1 | // 例03-18:ex03-18.cpp 2 | // 类类型的变量作为函数参数,返回值的演示 3 | 4 | class Clock 5 | { 6 | private: 7 | int H, M, S; 8 | public: 9 | Clock AddTime(Clock C2) // 形参为Clock类型的变量 10 | { 11 | Clock T; // 函数体中定义了Clock类型的变量 12 | ... 13 | return T; // 返回类型为Clock类型 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /codes/chap03/ex03-19.cpp: -------------------------------------------------------------------------------- 1 | // 例03-19:ex03-19.cpp 2 | // 创建 Stash 的实例,调用相关函数进行处理 3 | 4 | int main() 5 | { 6 | Stash s; 7 | 8 | s.initialize(); 9 | 10 | for(int i = 0; i < 100; i++) 11 | s.add(i); 12 | 13 | for(int j = 0; j < s.count(); j++) 14 | cout << "No." << j << " = " 15 | << s.fetch(j) << endl; 16 | 17 | s.cleanup(); 18 | } 19 | -------------------------------------------------------------------------------- /codes/chap03/ex03-20.cpp: -------------------------------------------------------------------------------- 1 | // 例03-20:ex03-20.cpp 2 | // 类中成员(数据或函数)protect 权限的示例 3 | 4 | class Stash 5 | { 6 | int size; // Number of a spaces 7 | int next; // Next empty space 8 | int *a;// Dynamically allocated arrays 9 | protected: 10 | void inflate(int increase); 11 | public: 12 | void initialize(); 13 | void cleanup(); 14 | int add(int element); 15 | int fetch(int index); 16 | int count(); 17 | }; 18 | -------------------------------------------------------------------------------- /codes/chap03/ex03-21.cpp: -------------------------------------------------------------------------------- 1 | // 例03-21:ex03-21.cpp 2 | // 用类定义栈类型 3 | 4 | class ch_stack 5 | { 6 | private: 7 | char *s; //栈的内容保存在s中 8 | int tp; //栈顶指示器,栈空为-1 9 | int size; 10 | public: 11 | void init(); 12 | void release(); 13 | void push(char c); 14 | char pop(); 15 | ... 16 | }; 17 | -------------------------------------------------------------------------------- /codes/chap03/ex03-22.cpp: -------------------------------------------------------------------------------- 1 | // 例03-22:ex03-22.cpp 2 | // 用类定义栈类型,类成员函数之间的调用 3 | 4 | class ch_stack 5 | { 6 | char *s; 7 | int tp; 8 | int size; 9 | public: 10 | ch_stack() // 默认构造函数 11 | { 12 | init(); 13 | } 14 | void init(); // 初始化函数 15 | ... 16 | }; 17 | -------------------------------------------------------------------------------- /codes/chap03/ex03-24.cpp: -------------------------------------------------------------------------------- 1 | // 例03-24:ex03-24.cpp 2 | // 类 CTetromino 默认构造函数的实现 3 | 4 | CTetromino::CTetromino() 5 | { 6 | size = 20; 7 | speed = 1; 8 | color = 0xFF0000; 9 | vxInit = 600 / (2 * size) - 2; 10 | vyInit = 800 / size - 1; 11 | vx[0] = 0; vy[0] = 0; 12 | vx[1] = 1; vy[1] = 0; 13 | vx[2] = 2; vy[2] = 0; 14 | vx[3] = 3; vy[3] = 0; 15 | } 16 | -------------------------------------------------------------------------------- /codes/chap03/ex03-26.cpp: -------------------------------------------------------------------------------- 1 | // 例03-26:ex03-26.cpp 2 | // 演示类中析构函数的定义及实现 3 | 4 | class ch_stack 5 | { 6 | char *s; 7 | int tp; 8 | int size; 9 | public: 10 | ~ch_stack() 11 | { 12 | release(); 13 | } 14 | void release(); 15 | ... 16 | }; 17 | -------------------------------------------------------------------------------- /codes/chap03/ex03-27.cpp: -------------------------------------------------------------------------------- 1 | // 例03-27:ex03-27.cpp 2 | int main 3 | { 4 | ch_stack s; 5 | s.init(); 6 | ... 7 | s.release();|\tikzmark{releaseprotoa}| 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /codes/chap03/ex03-28.cpp: -------------------------------------------------------------------------------- 1 | // 例03-28:ex03-28.cpp 2 | int main 3 | { 4 | ch_stack s; 5 | ... 6 | |\tikzmark{releaseprotob}|return 0; 7 | } 8 | -------------------------------------------------------------------------------- /codes/chap03/ex03-29.cpp: -------------------------------------------------------------------------------- 1 | // 例03-29:ex03-29.cpp 2 | // 类默认构造函数的定义 3 | 4 | class ch_stack 5 | { 6 | char *s; 7 | int tp; 8 | int size; 9 | public: 10 | ch_stack(); 11 | |\textcolor{red}{\textbf {ch\_stack(ch\_stack \&sObj)}}|; 12 | ... 13 | }; 14 | -------------------------------------------------------------------------------- /codes/chap03/ex03-30.cpp: -------------------------------------------------------------------------------- 1 | // 例03-30:ex03-30.cpp 2 | // 类拷贝构造函数的实现(浅拷贝) 3 | 4 | ch_stack::ch_stack(ch_stack & sObj) 5 | { 6 | size = sObj.size; 7 | tp = sObj.tp; 8 | s = sObj.s; 9 | } 10 | -------------------------------------------------------------------------------- /codes/chap03/ex03-31.cpp: -------------------------------------------------------------------------------- 1 | // 例03-31:ex03-31.cpp 2 | // 类拷贝构造函数的效果演示 3 | 4 | int main() 5 | { 6 | ch_stack s; 7 | 8 | for(int i = 0; i < 7; i++) 9 | s.push('a' +i); 10 | 11 | // 自动调用拷贝构造函数 12 | ch_stack sCopy(s); 13 | 14 | while(!s.empty()) s.pop(); 15 | 16 | for(int i = 0; i < 7; i++) 17 | s.push('1' +i); 18 | 19 | while(!sCopy.empty) 20 | cout << sCopy.pop(); 21 | cout << endl; 22 | } 23 | -------------------------------------------------------------------------------- /codes/chap03/ex03-32.cpp: -------------------------------------------------------------------------------- 1 | // 例03-32:ex03-32.cpp 2 | // 类拷贝构造函数的实现(深拷贝) 3 | 4 | ch_stack::ch_stack(ch_stack & sObj) 5 | { 6 | size = sObj.size; 7 | tp = sObj.tp; 8 | s = NULL; 9 | if (size != 0) 10 | { 11 | s = (char *)malloc(size); 12 | for (int i = 0; i <= tp; i++) 13 | s[i] = sObj.s[i]; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /codes/chap03/ex03-33-01.cpp: -------------------------------------------------------------------------------- 1 | // 例03-33-01:ex03-33-01.cpp 2 | // 构造函数重载,理解 this 指针 3 | 4 | class Point2D 5 | { 6 | float x, y; 7 | public: 8 | Point2D() 9 | { 10 | x = y = 0; 11 | } 12 | Point2D(int x, int y) 13 | { 14 | this->x = x; 15 | this->y = y; 16 | } 17 | 18 | void Output() 19 | { 20 | cout << this << endl; 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /codes/chap03/ex03-33-02.cpp: -------------------------------------------------------------------------------- 1 | // 例03-33-02:ex03-33-02.cpp 2 | // this 指针的值及其意义 3 | 4 | int main() 5 | { 6 | Point2D v0, v1; 7 | 8 | cout << "Address of Object v0:" 9 | << &v0 << endl; 10 | cout << "Address of Object v1:" 11 | << &v1 << endl; 12 | 13 | v0.Output(); 14 | v1.Output(); 15 | 16 | return 0; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /codes/chap03/ex03-34.cpp: -------------------------------------------------------------------------------- 1 | // 例03-34:ex03-34.cpp 2 | 3 | int main() 4 | { 5 | Point2D v0, v1; 6 | ... 7 | return 0; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /codes/chap03/ex03-35.cpp: -------------------------------------------------------------------------------- 1 | // 例03-35:ex03-35.cpp 2 | // C++ 基本绘图函数的演示 3 | 4 | #include 5 | 6 | using namespace graph; 7 | 8 | void display() 9 | { 10 | circle(512, 384, 100); 11 | putText(480, 384, "Hello World!"); 12 | } 13 | 14 | int main(int argc, char *argv[]) 15 | { 16 | initGraph(display); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /codes/chap03/ex03-36-main.cpp: -------------------------------------------------------------------------------- 1 | // 例03-36:ex03-36.cpp 2 | // C++ 基本绘图函数的演示 3 | 4 | #include 5 | #include "rectangle.h" 6 | using namespace graph; 7 | CRectangle rect(100, 100, 200, 100); 8 | void display() 9 | { 10 | rect.drawObj(); 11 | } 12 | void keyboard(unsigned char key) 13 | { 14 | rect.moveObj(); 15 | } 16 | int main(int argc, char *argv[]) 17 | { 18 | initGraph(display, keyboard); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /codes/chap03/ex03-36-point.h: -------------------------------------------------------------------------------- 1 | // 例03-36:ex03-36-point.h 2 | // CPoint2D类的定义 3 | #ifndef CPOINT2D_H 4 | #define CPOINT2D_H 5 | class CPoint2D 6 | { 7 | public: 8 | CPoint2D(); 9 | CPoint2D(int x, int y); 10 | CPoint2D(CPoint2D &pt); 11 | int getX(){ 12 | return m_x; 13 | } 14 | int getY(){ 15 | return m_y; 16 | } 17 | void movePoint(); 18 | private: 19 | int m_x; 20 | int m_y; 21 | }; 22 | #endif // CPOINT2D_H 23 | -------------------------------------------------------------------------------- /codes/chap03/ex03-37-01-02.cpp: -------------------------------------------------------------------------------- 1 | // 例 03-37-01-singleton : ex03-37-01.cpp 2 | Singleton* Singleton::sp = nullptr; 3 | 4 | Singleton* Singleton::getInstance(int _num){ 5 | if(sp == nullptr) {sp = new Singleton(_num);} 6 | return sp; 7 | } 8 | 9 | int main(){ 10 | Singleton* sp = Singleton::getInstance(1); 11 | sp->handle(); 12 | Singleton* st = Singleton::getInstance(10); 13 | st->handle(); 14 | } 15 | -------------------------------------------------------------------------------- /codes/chap03/ex03-37-main.cpp: -------------------------------------------------------------------------------- 1 | // 例03-37:ex03-37-main.cpp 2 | int CPoint2D::|\tikzmark{a\thepage}|num = 0; 3 | 4 | int main() 5 | { 6 | CPoint2D v0, v1; 7 | int num1, num2; 8 | num1 = |\textcolor{red}{\textbf CPoint2D::GetCounter()}|; 9 | num2 = |\textcolor{red}{\textbf v0.GetCounter()}|; 10 | } 11 | -------------------------------------------------------------------------------- /codes/chap03/ex03-38-01-01.cpp: -------------------------------------------------------------------------------- 1 | // 例 03-38-01 : ex03-38-01-01.cpp 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Data 7 | { 8 | public: 9 | int a, b, c; 10 | void printf() const 11 | { 12 | cout << "a = " << a 13 | << ", b = " << b 14 | << ", c = " << c << endl; 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /codes/chap03/ex03-38-01-02.cpp: -------------------------------------------------------------------------------- 1 | // 例 03-38-01 : ex03-38-01-02.cpp 2 | int main() 3 | { 4 | Data d, *dp = &d; 5 | 6 | int Data::*pmInt = &Data::a; 7 | // pmInt指向Data的int成员 8 | dp->*pmInt = 12; 9 | pmInt = &Data::b; 10 | d.*pmInt = 24; 11 | pmInt = &Data::c; 12 | dp->*pmInt = 36; 13 | dp->printf(); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /codes/chap03/ex03-38-02-02.cpp: -------------------------------------------------------------------------------- 1 | // 例 03-38-02 : ex03-38-02-02.cpp 2 | void select(int i, int j){ 3 | if(i < 0 || i >= cnt) 4 | return; 5 | (this->*fptr[i])(j); 6 | } 7 | int count() {return cnt;} 8 | }; 9 | 10 | int main() 11 | { 12 | FuncTable ft; 13 | for(int i = 0; i < ft.count(); i++){ 14 | ft.select(i, 20); 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /codes/chap03/ex03-38.cpp: -------------------------------------------------------------------------------- 1 | // 例ex03-38:ex03-38.cpp 2 | class A 3 | { 4 | private: 5 | int i ; 6 | void MemberFun(int) ; 7 | friend void FriendFun(A * , int);|\tikzmark{c\thepage}| 8 | } ; 9 | 10 | void FriendFun(A * ptr , int x)|\tikzmark{d\thepage}| 11 | { 12 | ptr -> i = x ; 13 | } 14 | void A::MemberFun( int x ) 15 | { 16 | i = x ; 17 | } 18 | -------------------------------------------------------------------------------- /codes/chap03/ex03-39.cpp: -------------------------------------------------------------------------------- 1 | // 例ex03-39:ex03-39.cpp 2 | class A 3 | { 4 | private: 5 | int i ; 6 | void MemberFun(int) ; 7 | friend void FriendFun(A * , int) ; 8 | } ; 9 | 10 | |\textcolor{red}{\textbf{friend}}||\tikzmark{c\thepage}| void |\textcolor{red}{\textbf A::}|FriendFun(A * ptr , int x) 11 | { 12 | ptr->i = x ; 13 | } 14 | void A::MemberFun( int x ) 15 | { 16 | i = x ; 17 | } 18 | -------------------------------------------------------------------------------- /codes/chap03/ex03-40.cpp: -------------------------------------------------------------------------------- 1 | // 例03-40:ex03-40.cpp 2 | // 类友元函数的定义及实现 3 | 4 | class A 5 | { 6 | private: 7 | int i ; 8 | void MemberFun(int); 9 | friend void FriendFun(A * , int); 10 | }; 11 | 12 | void FriendFun(A * ptr , int x) 13 | { 14 | |\textcolor{red}{\textbf i = x}|;|\tikzmark{c\thepage}| 15 | } 16 | void A::MemberFun(int x) 17 | { 18 | i = x; 19 | } 20 | -------------------------------------------------------------------------------- /codes/chap03/ex03-42.cpp: -------------------------------------------------------------------------------- 1 | // 例03-42:ex03-42.cpp 2 | 3 | class B; // 前向声明 4 | class A 5 | { 6 | public: 7 | void funA(B b); 8 | }; 9 | 10 | class B 11 | { 12 | public: 13 | void funB(A b); 14 | }; 15 | -------------------------------------------------------------------------------- /codes/chap03/ex03-44-Point2D.cpp: -------------------------------------------------------------------------------- 1 | // 例03-44:ex03-44.cpp 2 | // CPoint2D 的定义 3 | 4 | class CPoint2D 5 | { 6 | public: 7 | float x, y; 8 | CPoint2D() 9 | { 10 | x = y = 0; 11 | } 12 | CPoint2D(float x, float y) 13 | { 14 | this->x = x; 15 | this->y = y; 16 | } 17 | void Translate(float x, float y); 18 | void Scale(float r); 19 | void Rotate(float angle); 20 | }; 21 | -------------------------------------------------------------------------------- /codes/chap03/ex03-45-Point2D.cpp: -------------------------------------------------------------------------------- 1 | // 例03-45:ex03-45.cpp 2 | 3 | class CPoint2D 4 | { 5 | |\textcolor{red}{\textbf float x, y}|; 6 | public: 7 | CPoint2D() 8 | { 9 | x = y = 0; 10 | } 11 | CPoint2D(float x, float y) 12 | { 13 | this->x = x; 14 | this->y = y; 15 | } 16 | void Translate(float x, float y); 17 | void Scale(float r); 18 | void Rotate(float angle); 19 | friend class CRectangle; 20 | }; 21 | -------------------------------------------------------------------------------- /codes/chap03/ex03-46.cpp: -------------------------------------------------------------------------------- 1 | // 例ex03-46:ex03-46.cpp 2 | void CRectangle::Draw() 3 | { 4 | SetPenColorHex(color); 5 | DrawFillBox(wPos.x + lv1.x, wPos.y + lv1.y, 6 | wPos.x + lv2.x, wPos.y + lv2.y, 7 | wPos.x + lv3.x, wPos.y + lv3.y, 8 | wPos.x|\tikzmark{b\thepage}| + lv4.x|\tikzmark{c\thepage}|, wPos.y + lv4.y); 9 | } 10 | -------------------------------------------------------------------------------- /codes/chap03/ex03-47-Point2D.cpp: -------------------------------------------------------------------------------- 1 | // 例03-47:ex03-47.cpp 2 | // CPoint2D 的实现 3 | 4 | class CPoint2D 5 | { 6 | float x, y; 7 | public: 8 | CPoint2D() 9 | { 10 | x = y = 0; 11 | } 12 | CPoint2D(float x, float y) 13 | { 14 | this->x = x; 15 | this->y = y; 16 | } 17 | void Translate(float x, float y) 18 | { 19 | this->x = this->x + x; 20 | this->y = this->y + y; 21 | } 22 | //… 23 | }; 24 | -------------------------------------------------------------------------------- /codes/chap03/ex03-47-main.cpp: -------------------------------------------------------------------------------- 1 | // 例03-47:ex03-47.cpp 2 | 3 | int main() 4 | { 5 | const CPoint2D p1(1, 2); 6 | p1.Translate(1, 1);|\badmark| 7 | 8 | CPoint2D p2; 9 | p1 = p2;|\badmark| 10 | } 11 | -------------------------------------------------------------------------------- /codes/chap03/ex03-48-constattr.cpp: -------------------------------------------------------------------------------- 1 | // 例03-48:ex03-48.cpp 2 | 3 | class A 4 | { 5 | private: 6 | const int& r; //常引用数据成员 7 | const int a; //常数据成员 8 | static const int b; //静态常数据成员 9 | public: 10 | A(int i): a(i), r(a) 11 | { 12 | cout << "constructor!" << endl; 13 | }; 14 | void display() 15 | { 16 | cout << a << "," << b << "," << r << endl; 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /codes/chap03/ex03-49-constfun.cpp: -------------------------------------------------------------------------------- 1 | // 例03-49:ex03-49.cpp 2 | // CPoint2D 的定义 3 | 4 | class CPoint2D{ 5 | float x, y; 6 | public: 7 | CPoint2D(){ 8 | x = y = 0; 9 | } 10 | CPoint2D(float x, float y){ 11 | this->x = x; this->y = y; 12 | } 13 | float GetX() const { 14 | return x; 15 | } 16 | float GetY() const; 17 | void Set(float x, float y){ 18 | this->x = x; this->y = y; 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /codes/chap03/ex03-49-main.cpp: -------------------------------------------------------------------------------- 1 | // 例03-49:ex03-49.cpp 2 | 3 | float CPoint2D::GetY() const 4 | { 5 | return y; 6 | } 7 | int main() 8 | { 9 | const CPoint2D p(1, 2); 10 | float x = p.GetX(); 11 | float y = p.GetY(); 12 | } 13 | -------------------------------------------------------------------------------- /codes/chap03/ex03-50-constfun.cpp: -------------------------------------------------------------------------------- 1 | // 例ex03-50-constfun.cpp 2 | class CPoint2D{ 3 | float x, y; 4 | public: 5 | CPoint2D(){ 6 | x = y = 0; 7 | } 8 | CPoint2D(float x, float y){ 9 | this->x = x; this->y = y; 10 | } 11 | float GetX() const { 12 | return x; 13 | } 14 | float GetY() const; 15 | void Set(float x, float y) const|\tikzmark{b\thepage}| { 16 | this->x = x; this->y = y;|\badmark| 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /codes/chap03/ex03-51-main.cpp: -------------------------------------------------------------------------------- 1 | // 例ex03-51-main.cpp 2 | float CPoint2D::GetY() const 3 | { 4 | return y; 5 | } 6 | int main() 7 | { 8 | const CPoint2D p(1, 2); 9 | float x = p.GetX|\tikzmark{d\thepage}|(); 10 | float y = |\tikzmark{e\thepage}| p.GetY(); 11 | } 12 | -------------------------------------------------------------------------------- /codes/chap03/ex03-53-ctorseq.cpp: -------------------------------------------------------------------------------- 1 | // 例03-53:ex03-53.cpp 2 | // 构造函数,析构函数 3 | 4 | #include 5 | #include 6 | using namespace std; 7 | class base{ 8 | string mark; 9 | public: 10 | base(string str){ 11 | mark = str; 12 | cout << "Constructor " 13 | << mark << endl; 14 | } 15 | ~base(){ 16 | cout << "Destructor " 17 | << mark << endl; 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /codes/chap03/graph2d-leopard-circles.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap03/graph2d-leopard-circles.zip -------------------------------------------------------------------------------- /codes/chap03/handle.cpp: -------------------------------------------------------------------------------- 1 | #include "handle.h" 2 | 3 | struct Handle::Inner 4 | { 5 | int i; 6 | }; 7 | 8 | void Handle::initialize() 9 | { 10 | pointer = new Inner; 11 | pointer->i = 0; 12 | } 13 | 14 | void Handle::cleanup() 15 | { 16 | delete pointer; 17 | } 18 | 19 | int Handle::read() 20 | { 21 | return pointer->i; 22 | } 23 | 24 | void Handle::change(int x) 25 | { 26 | pointer->i = x; 27 | } 28 | -------------------------------------------------------------------------------- /codes/chap03/handle.h: -------------------------------------------------------------------------------- 1 | #ifndef HANDLE_H_INCLUDED 2 | #define HANDLE_H_INCLUDED 3 | 4 | class Handle{ 5 | public: 6 | void initialize(); 7 | void cleanup(); 8 | int read(); 9 | void change(int); 10 | private: 11 | // 前向引用说明 12 | struct Inner; 13 | // 指向数据成员 14 | Inner * pointer; 15 | }; 16 | 17 | #endif // HANDLE_H_INCLUDED 18 | -------------------------------------------------------------------------------- /codes/chap03/leopard-circles-class.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap03/leopard-circles-class.zip -------------------------------------------------------------------------------- /codes/chap03/leopard-circles-multifiles.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap03/leopard-circles-multifiles.zip -------------------------------------------------------------------------------- /codes/chap04/MatrixClass.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap04/MatrixClass.zip -------------------------------------------------------------------------------- /codes/chap04/Rect-Point-Matrix.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap04/Rect-Point-Matrix.zip -------------------------------------------------------------------------------- /codes/chap04/ex04-01-02-main.cpp: -------------------------------------------------------------------------------- 1 | // 例04-01-02:ex04-01-02.cpp 2 | // 重载操作符的测试 3 | 4 | int main() 5 | { 6 | CLocation Tiananmen(39.907306, 116.391264); 7 | CLocation Offset(-5.642159, -8.323558); 8 | CLocation Yangling; 9 | 10 | Tiananmen.show(); 11 | 12 | Yangling = Tiananmen + Offset; 13 | 14 | Yangling.show(); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /codes/chap04/ex04-02-02-main.cpp: -------------------------------------------------------------------------------- 1 | // 例04-02-02:ex04-02-02.cpp 2 | // 重载操作符的测试 3 | 4 | int main(){ 5 | CLocation ob1(39.907306, 6 | 116.391264); 7 | CLocation ob2, ob3; 8 | ob1.show(); 9 | ob2 = ++ob1; 10 | ob2.show(); 11 | // multiple assignment 12 | ob3 = ob2 = ob1; 13 | ob1 = ob1 - ob2; 14 | ob1.show(); 15 | ob2.show(); 16 | ob3.show(); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /codes/chap04/ex04-03-01-PrePost.cpp: -------------------------------------------------------------------------------- 1 | // 例04-03-01:ex04-03-01.cpp 2 | // + 及 ++ 作为成员函数的重载 3 | 4 | // Overload prefix ++ for CLocation. 5 | CLocation CLocation::operator++() 6 | { 7 | longitude++; 8 | latitude++; 9 | return *this; 10 | } 11 | 12 | // Overload postfix ++ for CLocation. 13 | CLocation CLocation::operator++(int x) 14 | { 15 | longitude++; 16 | latitude++; 17 | return CLocation(latitude - 1, longitude - 1); 18 | } 19 | -------------------------------------------------------------------------------- /codes/chap04/ex04-03-02-main.cpp: -------------------------------------------------------------------------------- 1 | // 例04-03-02:ex04-03-02.cpp 2 | // 重载操作符的测试 3 | 4 | int main() 5 | { 6 | CLocation ob1(39.907306, 7 | 116.391264); 8 | CLocation ob2, ob3; 9 | 10 | ob2 = ++ob1; 11 | ob3 = ob2++; 12 | 13 | ob1.show(); 14 | ob2.show(); 15 | ob3.show(); 16 | } 17 | -------------------------------------------------------------------------------- /codes/chap04/ex04-05-02-main.cpp: -------------------------------------------------------------------------------- 1 | // 例04-05-02:ex04-05-02.cpp 2 | // 重载 * 操作符的测试 3 | 4 | int main() 5 | { 6 | CLocation ob1(39.907306, 7 | 116.391264); 8 | CLocation ob2, ob3; 9 | 10 | ob2 = ob1 * 1.01; 11 | ob3 = -1.01 * ob1; 12 | 13 | ob1.show(); 14 | ob2.show(); 15 | ob3.show(); 16 | } 17 | -------------------------------------------------------------------------------- /codes/chap04/ex04-07-01-index.cpp: -------------------------------------------------------------------------------- 1 | // 例04-07-01:ex04-07-01.cpp 2 | // 重载 [] 操作符 3 | 4 | class atype{ 5 | int a[3]; 6 | public: 7 | atype(int i, int j, int k){ 8 | a[0] = i; 9 | a[1] = j; 10 | a[2] = k; 11 | } 12 | int &operator[](int i){ 13 | if(i < 0 || i > 2) 14 | { 15 | cout << "Boundary Error\n"; 16 | exit(1); 17 | } 18 | return a[i]; 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /codes/chap04/ex04-07-02-main.cpp: -------------------------------------------------------------------------------- 1 | // 例04-07-02:ex04-07-02.cpp 2 | // 重载 [] 操作符的测试 3 | 4 | int main() 5 | { 6 | atype ob(1, 2, 3); 7 | cout << ob[1]; 8 | cout << " "; 9 | ob[1] = 25; 10 | cout << ob[1]; 11 | ob[3] = 44; 12 | } 13 | -------------------------------------------------------------------------------- /codes/chap04/ex04-08-01-fun.cpp: -------------------------------------------------------------------------------- 1 | // 例04-08-01:ex04-08-01.cpp 2 | // + ,()运算符的重载 3 | 4 | 5 | class loc 6 | { 7 | double longitude, latitude; 8 | public: 9 | ... 10 | loc operator+(loc op2); 11 | loc operator()(double i, double j) 12 | { 13 | longitude = j; 14 | latitude = i; 15 | return *this; 16 | } 17 | }; 18 | 19 | -------------------------------------------------------------------------------- /codes/chap04/ex04-08-02-main.cpp: -------------------------------------------------------------------------------- 1 | // 例04-08-02:ex04-08-02.cpp 2 | // 运算符重载的测试 3 | 4 | int main() 5 | { 6 | loc ob1(10, 20), ob2(1, 1); 7 | ob1.show(); 8 | ob1(7, 8); 9 | ob1.show(); 10 | ob1 = ob2 + ob1(10, 10); 11 | ob1.show(); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /codes/chap05/01ShapeClass/Point2D.cpp: -------------------------------------------------------------------------------- 1 | #include "Point2D.h" 2 | -------------------------------------------------------------------------------- /codes/chap05/02ShapeClass-DerivedType/Donet.cpp: -------------------------------------------------------------------------------- 1 | #include "Donet.h" 2 | 3 | -------------------------------------------------------------------------------- /codes/chap05/02ShapeClass-DerivedType/Donet.h: -------------------------------------------------------------------------------- 1 | #ifndef DONET_H_INCLUDED 2 | #define DONET_H_INCLUDED 3 | 4 | #include "Ellipse.h" 5 | 6 | class CDonut: public CEllipse 7 | { 8 | float ratio; 9 | public: 10 | void Draw() 11 | { 12 | //ULONG color1 = CShape::textColor; 13 | CPoint2D pos = CShape::wPos; 14 | ULONG color2 = CShape::objColor; 15 | } 16 | }; 17 | 18 | 19 | #endif // DONET_H_INCLUDED 20 | -------------------------------------------------------------------------------- /codes/chap05/02ShapeClass-DerivedType/Ellipse.cpp: -------------------------------------------------------------------------------- 1 | #include "Ellipse.h" 2 | -------------------------------------------------------------------------------- /codes/chap05/02ShapeClass-DerivedType/Ellipse.h: -------------------------------------------------------------------------------- 1 | #ifndef ELLIPSE_H_INCLUDED 2 | #define ELLIPSE_H_INCLUDED 3 | 4 | #include "Shape.h" 5 | 6 | class CEllipse: public CShape 7 | { 8 | float x_radius, y_radius; 9 | public: 10 | void Draw() 11 | { 12 | //ULONG color1 = CShape::textColor; 13 | CPoint2D pos = CShape::wPos; 14 | ULONG color2 = CShape::objColor; 15 | } 16 | }; 17 | 18 | #endif // ELLIPSE_H_INCLUDED 19 | -------------------------------------------------------------------------------- /codes/chap05/02ShapeClass-DerivedType/Point2D.cpp: -------------------------------------------------------------------------------- 1 | #include "Point2D.h" 2 | -------------------------------------------------------------------------------- /codes/chap05/02ShapeClass-DerivedType/Shape.cpp: -------------------------------------------------------------------------------- 1 | #include "Shape.h" 2 | 3 | -------------------------------------------------------------------------------- /codes/chap05/02ShapeClass-DerivedType/Shape.h: -------------------------------------------------------------------------------- 1 | #ifndef SHAPE_H_INCLUDED 2 | #define SHAPE_H_INCLUDED 3 | 4 | #include 5 | #include "Point2D.h" 6 | 7 | using namespace graph; 8 | 9 | class CShape 10 | { 11 | ULONG textColor; 12 | char strText[256]; 13 | protected: 14 | CPoint2D wPos; 15 | public: 16 | ULONG objColor; 17 | }; 18 | 19 | #endif // SHAPE_H_INCLUDED 20 | -------------------------------------------------------------------------------- /codes/chap05/02ShapeClass-DerivedType/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Shape.h" 3 | #include "Ellipse.h" 4 | #include "Donet.h" 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | CEllipse myEllip; 9 | 10 | //ULONG color1 = myEllip.textColor; 11 | CPoint2D pos = myEllip.wPos; 12 | ULONG color2 = myEllip.objColor; 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /codes/chap05/03testCtorDtor/base.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap05/03testCtorDtor/base.h -------------------------------------------------------------------------------- /codes/chap05/03testCtorDtor/derived.h: -------------------------------------------------------------------------------- 1 | #ifndef DERIVED_H_INCLUDED 2 | #define DERIVED_H_INCLUDED 3 | 4 | #include "memobj.h" 5 | #include "base.h" 6 | 7 | class derived: public base 8 | { 9 | memObj obj2; 10 | public: 11 | derived():obj2(2) 12 | { 13 | cout << "Constructing derived\n"; 14 | } 15 | ~derived() 16 | { 17 | cout << "Destructing derived\n"; 18 | } 19 | }; 20 | 21 | #endif // DERIVED_H_INCLUDED 22 | -------------------------------------------------------------------------------- /codes/chap05/03testCtorDtor/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "derived.h" 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | derived ob; 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /codes/chap05/04testToBaseFun/testToBaseFun.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap05/05-02Shape.h: -------------------------------------------------------------------------------- 1 | // 例05-02:ex05-02.cpp 2 | 3 | class CShape{ 4 | ULONG textColor; 5 | char strText[256]; 6 | protected: 7 | CPoint2D wPos; 8 | ULONG objColor; 9 | public: 10 | CShape(); 11 | CShape(CPoint2D w, char *strText, 12 | ULONG objColor = 0xBBE0E3, 13 | ULONG textColor = 0): wPos(w); 14 | void Translate(float x, float y); 15 | void DrawText(); 16 | void ShowPos(); 17 | }; 18 | -------------------------------------------------------------------------------- /codes/chap05/05-08init-01.cpp: -------------------------------------------------------------------------------- 1 | // 例05-08-01:ex05-08-01.cpp 2 | // 构造函数和析构函数的演示 3 | 4 | 5 | #include 6 | 7 | using namespace std; 8 | class memObj 9 | { 10 | int a; 11 | public: 12 | memObj(int x) 13 | { 14 | a = x; 15 | cout << "Constructing member object " << a << endl; 16 | } 17 | ~memObj() 18 | { 19 | cout << "Destructing member object" << a << endl; 20 | } 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /codes/chap05/05-08init-02.cpp: -------------------------------------------------------------------------------- 1 | // 例05-08-02:ex05-08-02.cpp 2 | // 定义一个简单的类,包含一个属性, 3 | // 构造函数和析构函数 4 | 5 | class base 6 | { 7 | memObj obj1; 8 | public: 9 | //该构造函数有成员初始化列表 10 | base():obj1(1) 11 | { 12 | cout << "Constructing base\n"; 13 | } 14 | ~base() 15 | { 16 | cout << "Destructing base\n"; 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /codes/chap05/05-08init-03.cpp: -------------------------------------------------------------------------------- 1 | // 例05-08-03:ex05-08-03.cpp 2 | //定义类derived,该类继承base类 3 | 4 | class derived: public base 5 | { 6 | memObj obj2; 7 | public: 8 | derived():obj2(2) 9 | { 10 | cout << "Constructing derived\n"; 11 | } 12 | ~derived() 13 | { 14 | cout << "Destructing derived\n"; 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /codes/chap05/05-08init-04.cpp: -------------------------------------------------------------------------------- 1 | // 例05-08-04:ex05-08-04.cpp 2 | 3 | int main() 4 | { 5 | derived ob; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /codes/chap05/05-09basecls.cpp: -------------------------------------------------------------------------------- 1 | // 例05-09:ex05-09.cpp 2 | // 类 protect 属性 和 3 | // public 方法 的演示 4 | #include 5 | 6 | using namespace std; 7 | class base1 8 | { 9 | protected: 10 | int x; 11 | public: 12 | void showx() 13 | { 14 | cout << x << "\n"; 15 | } 16 | }; 17 | class base2 18 | { 19 | protected: 20 | int y; 21 | public: 22 | void showy() 23 | { 24 | cout << y << "\n"; 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /codes/chap05/05-09inheritcls.cpp: -------------------------------------------------------------------------------- 1 | // 例05-09:ex05-09.cpp 2 | //定义类derived,该类继承了base1和base2 3 | 4 | class derived: public base1, public base2 5 | { 6 | public: 7 | void set(int i, int j) 8 | { 9 | x=i; 10 | y=j; 11 | } 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /codes/chap05/05-09maincls.cpp: -------------------------------------------------------------------------------- 1 | // 例05-09:ex05-09.cpp 2 | 3 | int main() 4 | { 5 | derived ob; 6 | ob.set(10, 20); 7 | ob.showx(); 8 | ob.showy(); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /codes/chap05/05-10multibasectormain.cpp: -------------------------------------------------------------------------------- 1 | // 例05-10:ex05-10.cpp 2 | //定义类derived,该类继承了base1和base2 3 | 4 | class derived: public base1, public base2{ 5 | public: 6 | derived() { 7 | cout << "Constructing derived\n"; 8 | } 9 | ~derived() { 10 | cout << "Destructing derived\n"; 11 | } 12 | }; 13 | 14 | int main(){ 15 | derived ob; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /codes/chap05/05multiBase/multiBase.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap05/06multiBaseCtor/multiBaseCtor.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1496286470 source:c:\users\administrator\desktop\testcpp\multibasector\main.cpp 3 | 4 | 5 | -------------------------------------------------------------------------------- /codes/chap05/06multiBaseCtor/multiBaseCtor.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap05/07multiBasepegasus/Animal.h: -------------------------------------------------------------------------------- 1 | #ifndef CANIMAL_H 2 | #define CANIMAL_H 3 | 4 | class CAnimal 5 | { 6 | public: 7 | CAnimal(const char *strName="", int a=0, int w=0); 8 | ~CAnimal(); 9 | 10 | void Show(); 11 | 12 | private: 13 | char name[32]; 14 | int age; 15 | int weight; 16 | }; 17 | 18 | #endif // CANIMAL_H 19 | -------------------------------------------------------------------------------- /codes/chap05/07multiBasepegasus/Bird.h: -------------------------------------------------------------------------------- 1 | #ifndef CBIRD_H 2 | #define CBIRD_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBird : public CAnimal 7 | { 8 | public: 9 | CBird(int ws=0, const char *strName="", int a=0, int w=0); 10 | ~CBird(); 11 | 12 | void Show(); 13 | void Fly(); 14 | void Talk(); 15 | 16 | private: 17 | int wingSpan; 18 | }; 19 | 20 | #endif // CBIRD_H 21 | -------------------------------------------------------------------------------- /codes/chap05/07multiBasepegasus/Horse.h: -------------------------------------------------------------------------------- 1 | #ifndef CHORSE_H 2 | #define CHORSE_H 3 | 4 | #include "Animal.h" 5 | 6 | 7 | class CHorse : public CAnimal 8 | { 9 | public: 10 | CHorse(int pow=0, const char *strName="", int a=0, int w=0); 11 | ~CHorse(); 12 | 13 | void Show(); 14 | void Run(); 15 | void Talk(); 16 | 17 | private: 18 | int power; 19 | 20 | }; 21 | 22 | #endif // CHORSE_H 23 | -------------------------------------------------------------------------------- /codes/chap05/07multiBasepegasus/Pegasus.h: -------------------------------------------------------------------------------- 1 | #ifndef CPEGASUS_H 2 | #define CPEGASUS_H 3 | 4 | #include "Horse.h" 5 | #include "Bird.h" 6 | 7 | class CPegasus : public CHorse, public CBird 8 | { 9 | public: 10 | CPegasus(const char *strName="", int a=0, int w=0, int ws=0, int pow=0); 11 | ~CPegasus(); 12 | 13 | void Talk(); 14 | 15 | }; 16 | 17 | #endif // CPEGASUS_H 18 | -------------------------------------------------------------------------------- /codes/chap05/07multiBasepegasus/main.cpp: -------------------------------------------------------------------------------- 1 | #include "Animal.h" 2 | #include "Horse.h" 3 | #include "Bird.h" 4 | #include "Pegasus.h" 5 | 6 | int main() 7 | { 8 | CPegasus pegObj("Eagle", 5, 100, 2, 500); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /codes/chap05/08testusingkeyword/testInheritingBaseClassCtor/testInheritingBaseClassCtor.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1496310827 source:/home/registor/Desktop/testCPP/testInheritingBaseClassCtor/main.cpp 3 | 4 | 5 | -------------------------------------------------------------------------------- /codes/chap05/0XShapeClass/Point2D.cpp: -------------------------------------------------------------------------------- 1 | #include "Point2D.h" 2 | -------------------------------------------------------------------------------- /codes/chap05/0XShapeClass/c5aShapeClass.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap05/0XShapeClass/c5aShapeClass.rar -------------------------------------------------------------------------------- /codes/chap05/0XShapeClass/c5aShapeClass/Point2D.cpp: -------------------------------------------------------------------------------- 1 | #include "Point2D.h" 2 | -------------------------------------------------------------------------------- /codes/chap06/01-zoo-CAnimal.cpp: -------------------------------------------------------------------------------- 1 | // 例01-zoo-CAnimal:ex01-zoo-CAnimal.cpp 2 | 3 | class CAnimal 4 | { 5 | char name[32]; 6 | int age; 7 | int weight; 8 | public: 9 | CAnimal(const char *strName = "", int a = 0, int w = 0) 10 | { 11 | strcpy(name, strName); 12 | age = a; 13 | weight = w; 14 | } 15 | void Show() 16 | { 17 | cout << name << " " << age << " " << weight << " "; 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /codes/chap06/02-zoo-show.cpp: -------------------------------------------------------------------------------- 1 | // 例02-zoo-show:ex02-zoo-show.cpp 2 | // 实现动物园的Show方法 3 | 4 | void CZoo::Show() 5 | { 6 | for (int i = 0; i < sizeBird; i++) 7 | m_bird[i].Show(); 8 | for (int i = 0; i < sizeHorse; i++) 9 | m_horse[i].Show(); 10 | for (int i = 0; i < sizeBull; i++) 11 | m_bull[i].Show(); 12 | for (int i = 0; i < sizePeg; i++) 13 | m_peg[i].Show(); 14 | } 15 | -------------------------------------------------------------------------------- /codes/chap06/02-zoo-talk.cpp: -------------------------------------------------------------------------------- 1 | // 例02-zoo-talk:ex02-zoo-talk.cpp 2 | // 实现动物园的Talk方法 3 | 4 | void CZoo::Talk() 5 | { 6 | for (int i = 0; i < sizeBird; i++) 7 | m_bird[i].Talk(); 8 | for (int i = 0; i < sizeHorse; i++) 9 | m_horse[i].Talk(); 10 | for (int i = 0; i < sizeBull; i++) 11 | m_bull[i].Talk(); 12 | for (int i = 0; i < sizePeg; i++) 13 | m_peg[i].Talk(); 14 | } 15 | -------------------------------------------------------------------------------- /codes/chap06/03-zoo-show-talk.cpp: -------------------------------------------------------------------------------- 1 | // 例03-zoo-show-talk:ex03-zoo-show-talk.cpp 2 | // 实现类中的成员函数 3 | 4 | void CZoo::Show() 5 | { 6 | for (int i = 0; i < size; i++) 7 | m_animal[i]->Show(); 8 | } 9 | 10 | void CZoo::Talk() 11 | { 12 | for (int i = 0; i < size; i++) 13 | m_animal[i]->Talk(); 14 | } 15 | -------------------------------------------------------------------------------- /codes/chap06/04-zoo-virtfun-show.cpp: -------------------------------------------------------------------------------- 1 | // 例04-zoo-virtfun-show.cpp 2 | // 实现CAnimal中的虚函数Show 3 | 4 | virtual void CAnimal::Show() 5 | { 6 | cout << name << " " << age << 7 | " " << weight << " "; 8 | } 9 | -------------------------------------------------------------------------------- /codes/chap06/04-zoo-virtfun-talk.cpp: -------------------------------------------------------------------------------- 1 | // 例04-zoo-virtfun-talk.cpp 2 | // 实现CAnimal中的虚函数Talk 3 | 4 | virtual void CAnimal::Talk() 5 | { 6 | cout << "Do nothing!" << endl; 7 | } 8 | -------------------------------------------------------------------------------- /codes/chap06/05-dtor-base.cpp: -------------------------------------------------------------------------------- 1 | // 例05-dtor-base:ex05-dtor-base.cpp 2 | // 构造函数和析构函数的演示 3 | 4 | class A 5 | { 6 | public: 7 | ~A() 8 | { 9 | cout << "A::~A() is called." << endl; 10 | } 11 | A() 12 | { 13 | cout << "A::A() is called." << endl; 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /codes/chap06/05-dtor-derived.cpp: -------------------------------------------------------------------------------- 1 | // 例05-dtor-derived:ex05-dtor-derived.cpp 2 | // 定义类B,该类继承类A 3 | 4 | class B: public A 5 | { 6 | private: 7 | int *ip; 8 | public: 9 | B(int size = 0) 10 | { 11 | ip = new int[size]; 12 | cout << "B::B() is called." << endl; 13 | } 14 | ~B() 15 | { 16 | cout << "B::~B() is called." << endl; 17 | delete []ip; 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /codes/chap06/05-dtor-main.cpp: -------------------------------------------------------------------------------- 1 | // 例05-dtor-main:ex05-dtor-main.cpp 2 | int main() 3 | { 4 | A *b = new B(10); 5 | delete b; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /codes/chap06/06-vdtor-base.cpp: -------------------------------------------------------------------------------- 1 | // 例06-vdtor-base:ex06-vdtor-base.cpp 2 | // 类虚析构函数的演示 3 | 4 | class A 5 | { 6 | public: 7 | virtual ~A() //虚析构函数 8 | { 9 | cout << "A::~A() is called." << endl; 10 | } 11 | A() 12 | { 13 | cout << "A::A() is called." << endl; 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /codes/chap06/07-abstract-main.cpp: -------------------------------------------------------------------------------- 1 | // 例07-abstract-main.cpp 2 | 3 | int main() 4 | { 5 | CAnimal anim("God");|\large \badmark| 6 | 7 | anim.Show(); 8 | anim.Talk(); 9 | 10 | return 0; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /codes/chap06/08-abstract-dtor.cpp: -------------------------------------------------------------------------------- 1 | // 例08-abstract-dtor:ex04-abstract-dtor.cpp 2 | // 实现类CShapeArr的析构函数 3 | 4 | CShapeArr::~CShapeArr() 5 | { 6 | //dtor 7 | if(size != 0) 8 | { 9 | for(int i=0; i< size; i++) 10 | { 11 | if(m_shape[i]!=NULL) 12 | delete m_shape[i]; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /codes/chap06/09-rtti-fun.cpp: -------------------------------------------------------------------------------- 1 | // 例09-rtti-fun:ex09-rtti-fun.cpp 2 | // 动态类型转换的演示 3 | 4 | void my_function(CBase* my_a) 5 | { 6 | CDerived *my_b = dynamic_cast(my_a); 7 | if(my_b != NULL) 8 | my_b->methodDerived(); 9 | else 10 | my_a->methodBase(); 11 | } 12 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/Animal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Animal.h" 4 | 5 | using namespace std; 6 | 7 | CAnimal::CAnimal(const char *strName, int a, int w) 8 | { 9 | //ctor 10 | strcpy(name, strName); 11 | age = a; 12 | weight = w; 13 | } 14 | 15 | 16 | void CAnimal::Show() 17 | { 18 | cout << name << " " << age << " " << weight << endl; 19 | } 20 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/Animal.h: -------------------------------------------------------------------------------- 1 | #ifndef CANIMAL_H 2 | #define CANIMAL_H 3 | 4 | class CAnimal 5 | { 6 | public: 7 | CAnimal(const char *strName="", int a=0, int w=0); 8 | 9 | void Show(); 10 | 11 | private: 12 | char name[32]; 13 | int age; 14 | int weight; 15 | }; 16 | 17 | #endif // CANIMAL_H 18 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/Bird.h: -------------------------------------------------------------------------------- 1 | #ifndef CBIRD_H 2 | #define CBIRD_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBird : virtual public CAnimal 7 | { 8 | public: 9 | CBird(const char *strName = "", int a = 0, int w = 0, int ws = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int wingSpan; 16 | }; 17 | 18 | #endif // CBIRD_H 19 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/Bull.h: -------------------------------------------------------------------------------- 1 | #ifndef CBULL_H 2 | #define CBULL_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBull: public CAnimal 7 | { 8 | public: 9 | CBull(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | private: 15 | int power; 16 | }; 17 | 18 | #endif // CBULL_H 19 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/Horse.h: -------------------------------------------------------------------------------- 1 | #ifndef CHORSE_H 2 | #define CHORSE_H 3 | 4 | #include "Animal.h" 5 | 6 | class CHorse : virtual public CAnimal 7 | { 8 | public: 9 | CHorse(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int power; 16 | 17 | }; 18 | 19 | #endif // CHORSE_H 20 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/Pegasus.h: -------------------------------------------------------------------------------- 1 | #ifndef CPEGASUS_H 2 | #define CPEGASUS_H 3 | 4 | #include "Horse.h" 5 | #include "Bird.h" 6 | 7 | class CPegasus : public CHorse, public CBird 8 | { 9 | public: 10 | CPegasus(const char *strName="", int a=0, int w=0, int ws=0, int pow=0); 11 | 12 | void Show(); 13 | void Talk(); 14 | 15 | }; 16 | 17 | #endif // CPEGASUS_H 18 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/Sound/Bull.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/Sound/Bull.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/Sound/Eagle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/Sound/Eagle.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/Sound/Horse.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/Sound/Horse.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/zoo.depend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/01zoo-2017-withoutCZoo/zoo.depend -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/Animal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Animal.h" 4 | 5 | using namespace std; 6 | 7 | CAnimal::CAnimal(const char *strName, int a, int w) 8 | { 9 | //ctor 10 | strcpy(name, strName); 11 | age = a; 12 | weight = w; 13 | } 14 | 15 | 16 | void CAnimal::Show() 17 | { 18 | cout << name << " " << age << " " << weight << endl; 19 | } 20 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/Animal.h: -------------------------------------------------------------------------------- 1 | #ifndef CANIMAL_H 2 | #define CANIMAL_H 3 | 4 | class CAnimal 5 | { 6 | public: 7 | CAnimal(const char *strName="", int a=0, int w=0); 8 | 9 | void Show(); 10 | 11 | private: 12 | char name[32]; 13 | int age; 14 | int weight; 15 | }; 16 | 17 | #endif // CANIMAL_H 18 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/Bird.h: -------------------------------------------------------------------------------- 1 | #ifndef CBIRD_H 2 | #define CBIRD_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBird : virtual public CAnimal 7 | { 8 | public: 9 | CBird(const char *strName = "", int a = 0, int w = 0, int ws = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int wingSpan; 16 | }; 17 | 18 | #endif // CBIRD_H 19 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/Bull.h: -------------------------------------------------------------------------------- 1 | #ifndef CBULL_H 2 | #define CBULL_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBull: public CAnimal 7 | { 8 | public: 9 | CBull(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | private: 15 | int power; 16 | }; 17 | 18 | #endif // CBULL_H 19 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/Horse.h: -------------------------------------------------------------------------------- 1 | #ifndef CHORSE_H 2 | #define CHORSE_H 3 | 4 | #include "Animal.h" 5 | 6 | class CHorse : virtual public CAnimal 7 | { 8 | public: 9 | CHorse(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int power; 16 | 17 | }; 18 | 19 | #endif // CHORSE_H 20 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/Pegasus.h: -------------------------------------------------------------------------------- 1 | #ifndef CPEGASUS_H 2 | #define CPEGASUS_H 3 | 4 | #include "Horse.h" 5 | #include "Bird.h" 6 | 7 | class CPegasus : public CHorse, public CBird 8 | { 9 | public: 10 | CPegasus(const char *strName="", int a=0, int w=0, int ws=0, int pow=0); 11 | 12 | void Show(); 13 | void Talk(); 14 | 15 | }; 16 | 17 | #endif // CPEGASUS_H 18 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/Sound/Bull.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/Sound/Bull.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/Sound/Eagle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/Sound/Eagle.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/Sound/Horse.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/Sound/Horse.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/zoo.depend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/02zoo-2017-withCZoo/zoo.depend -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Animal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Animal.h" 4 | 5 | using namespace std; 6 | 7 | CAnimal::CAnimal(const char *strName, int a, int w) 8 | { 9 | //ctor 10 | strcpy(name, strName); 11 | age = a; 12 | weight = w; 13 | } 14 | 15 | 16 | void CAnimal::Show() 17 | { 18 | cout << name << " " << age << " " << weight << endl; 19 | } 20 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Animal.h: -------------------------------------------------------------------------------- 1 | #ifndef CANIMAL_H 2 | #define CANIMAL_H 3 | 4 | class CAnimal 5 | { 6 | public: 7 | CAnimal(const char *strName="", int a=0, int w=0); 8 | 9 | void Show(); 10 | 11 | private: 12 | char name[32]; 13 | int age; 14 | int weight; 15 | }; 16 | 17 | #endif // CANIMAL_H 18 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Bird.h: -------------------------------------------------------------------------------- 1 | #ifndef CBIRD_H 2 | #define CBIRD_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBird : virtual public CAnimal 7 | { 8 | public: 9 | CBird(const char *strName = "", int a = 0, int w = 0, int ws = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int wingSpan; 16 | }; 17 | 18 | #endif // CBIRD_H 19 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Bull.h: -------------------------------------------------------------------------------- 1 | #ifndef CBULL_H 2 | #define CBULL_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBull: public CAnimal 7 | { 8 | public: 9 | CBull(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | private: 15 | int power; 16 | }; 17 | 18 | #endif // CBULL_H 19 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Horse.h: -------------------------------------------------------------------------------- 1 | #ifndef CHORSE_H 2 | #define CHORSE_H 3 | 4 | #include "Animal.h" 5 | 6 | class CHorse : virtual public CAnimal 7 | { 8 | public: 9 | CHorse(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int power; 16 | 17 | }; 18 | 19 | #endif // CHORSE_H 20 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Pegasus.h: -------------------------------------------------------------------------------- 1 | #ifndef CPEGASUS_H 2 | #define CPEGASUS_H 3 | 4 | #include "Horse.h" 5 | #include "Bird.h" 6 | 7 | class CPegasus : public CHorse, public CBird 8 | { 9 | public: 10 | CPegasus(const char *strName="", int a=0, int w=0, int ws=0, int pow=0); 11 | 12 | void Show(); 13 | void Talk(); 14 | 15 | }; 16 | 17 | #endif // CPEGASUS_H 18 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Sound/Bull.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Sound/Bull.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Sound/Eagle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Sound/Eagle.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Sound/Horse.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Sound/Horse.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/Zoo.h: -------------------------------------------------------------------------------- 1 | #ifndef ZOO_H_INCLUDED 2 | #define ZOO_H_INCLUDED 3 | 4 | class CAnimal; 5 | 6 | const int MAX_ANIM_NUM = 100; 7 | 8 | class CZoo 9 | { 10 | public: 11 | CZoo(); 12 | 13 | void Add(CAnimal *anim); 14 | 15 | void Show(); 16 | void Talk(); 17 | 18 | private: 19 | int size; 20 | CAnimal *m_animal[MAX_ANIM_NUM]; 21 | }; 22 | 23 | 24 | 25 | #endif // ZOO_H_INCLUDED 26 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/zoo.depend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/03zoo-2017-withCZooBasePointer/zoo.depend -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/Animal.h: -------------------------------------------------------------------------------- 1 | #ifndef CANIMAL_H 2 | #define CANIMAL_H 3 | 4 | class CAnimal 5 | { 6 | public: 7 | CAnimal(const char *strName="", int a=0, int w=0); 8 | 9 | virtual void Show(); 10 | virtual void Talk(); 11 | 12 | private: 13 | char name[32]; 14 | int age; 15 | int weight; 16 | }; 17 | 18 | #endif // CANIMAL_H 19 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/Bird.h: -------------------------------------------------------------------------------- 1 | #ifndef CBIRD_H 2 | #define CBIRD_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBird : virtual public CAnimal 7 | { 8 | public: 9 | CBird(const char *strName = "", int a = 0, int w = 0, int ws = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int wingSpan; 16 | }; 17 | 18 | #endif // CBIRD_H 19 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/Bull.h: -------------------------------------------------------------------------------- 1 | #ifndef CBULL_H 2 | #define CBULL_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBull: public CAnimal 7 | { 8 | public: 9 | CBull(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | private: 15 | int power; 16 | }; 17 | 18 | #endif // CBULL_H 19 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/Horse.h: -------------------------------------------------------------------------------- 1 | #ifndef CHORSE_H 2 | #define CHORSE_H 3 | 4 | #include "Animal.h" 5 | 6 | class CHorse : virtual public CAnimal 7 | { 8 | public: 9 | CHorse(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int power; 16 | 17 | }; 18 | 19 | #endif // CHORSE_H 20 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/Pegasus.h: -------------------------------------------------------------------------------- 1 | #ifndef CPEGASUS_H 2 | #define CPEGASUS_H 3 | 4 | #include "Horse.h" 5 | #include "Bird.h" 6 | 7 | class CPegasus : public CHorse, public CBird 8 | { 9 | public: 10 | CPegasus(const char *strName="", int a=0, int w=0, int ws=0, int pow=0); 11 | 12 | void Show(); 13 | void Talk(); 14 | 15 | }; 16 | 17 | #endif // CPEGASUS_H 18 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/Sound/Bull.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/Sound/Bull.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/Sound/Eagle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/Sound/Eagle.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/Sound/Horse.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/Sound/Horse.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/Zoo.h: -------------------------------------------------------------------------------- 1 | #ifndef ZOO_H_INCLUDED 2 | #define ZOO_H_INCLUDED 3 | 4 | class CAnimal; 5 | 6 | const int MAX_ANIM_NUM = 100; 7 | 8 | class CZoo 9 | { 10 | public: 11 | CZoo(); 12 | 13 | void Add(CAnimal *anim); 14 | 15 | void Show(); 16 | void Talk(); 17 | 18 | private: 19 | int size; 20 | CAnimal *m_animal[MAX_ANIM_NUM]; 21 | }; 22 | 23 | 24 | 25 | #endif // ZOO_H_INCLUDED 26 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/zoo.depend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/04zoo-2017-withVirtualFun/zoo.depend -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/05vitualDtor/vitualDtor.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/07DonutHouse-virtualFun/GlutBasic.depend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/07DonutHouse-virtualFun/GlutBasic.depend -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/07DonutHouse-virtualFun/Point2D.cpp: -------------------------------------------------------------------------------- 1 | #include "Point2D.h" 2 | -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/zoosound/Bull.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/zoosound/Bull.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/zoosound/Eagle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/zoosound/Eagle.wav -------------------------------------------------------------------------------- /codes/chap06/CB-Project-Codes/zoosound/Horse.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/CB-Project-Codes/zoosound/Horse.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/01zoo-2017-withoutCZoo/Animal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Animal.h" 4 | 5 | using namespace std; 6 | 7 | CAnimal::CAnimal(const char *strName, int a, int w) 8 | { 9 | //ctor 10 | strcpy(name, strName); 11 | age = a; 12 | weight = w; 13 | } 14 | 15 | 16 | void CAnimal::Show() 17 | { 18 | cout << name << " " << age << " " << weight << endl; 19 | } 20 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/01zoo-2017-withoutCZoo/Animal.h: -------------------------------------------------------------------------------- 1 | #ifndef CANIMAL_H 2 | #define CANIMAL_H 3 | 4 | class CAnimal 5 | { 6 | public: 7 | CAnimal(const char *strName="", int a=0, int w=0); 8 | 9 | void Show(); 10 | 11 | private: 12 | char name[32]; 13 | int age; 14 | int weight; 15 | }; 16 | 17 | #endif // CANIMAL_H 18 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/01zoo-2017-withoutCZoo/Bird.h: -------------------------------------------------------------------------------- 1 | #ifndef CBIRD_H 2 | #define CBIRD_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBird : virtual public CAnimal 7 | { 8 | public: 9 | CBird(const char *strName = "", int a = 0, int w = 0, int ws = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int wingSpan; 16 | }; 17 | 18 | #endif // CBIRD_H 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/01zoo-2017-withoutCZoo/Bull.h: -------------------------------------------------------------------------------- 1 | #ifndef CBULL_H 2 | #define CBULL_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBull: public CAnimal 7 | { 8 | public: 9 | CBull(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | private: 15 | int power; 16 | }; 17 | 18 | #endif // CBULL_H 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/01zoo-2017-withoutCZoo/Horse.h: -------------------------------------------------------------------------------- 1 | #ifndef CHORSE_H 2 | #define CHORSE_H 3 | 4 | #include "Animal.h" 5 | 6 | class CHorse : virtual public CAnimal 7 | { 8 | public: 9 | CHorse(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int power; 16 | 17 | }; 18 | 19 | #endif // CHORSE_H 20 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/01zoo-2017-withoutCZoo/Pegasus.h: -------------------------------------------------------------------------------- 1 | #ifndef CPEGASUS_H 2 | #define CPEGASUS_H 3 | 4 | #include "Horse.h" 5 | #include "Bird.h" 6 | 7 | class CPegasus : public CHorse, public CBird 8 | { 9 | public: 10 | CPegasus(const char *strName="", int a=0, int w=0, int ws=0, int pow=0); 11 | 12 | void Show(); 13 | void Talk(); 14 | 15 | }; 16 | 17 | #endif // CPEGASUS_H 18 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/01zoo-2017-withoutCZoo/Sound/Bull.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/01zoo-2017-withoutCZoo/Sound/Bull.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/01zoo-2017-withoutCZoo/Sound/Eagle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/01zoo-2017-withoutCZoo/Sound/Eagle.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/01zoo-2017-withoutCZoo/Sound/Horse.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/01zoo-2017-withoutCZoo/Sound/Horse.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/01zoo-2017-withoutCZoo/zoo.depend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/01zoo-2017-withoutCZoo/zoo.depend -------------------------------------------------------------------------------- /codes/chap06/wholecode/02zoo-2017-withCZoo/Animal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Animal.h" 4 | 5 | using namespace std; 6 | 7 | CAnimal::CAnimal(const char *strName, int a, int w) 8 | { 9 | //ctor 10 | strcpy(name, strName); 11 | age = a; 12 | weight = w; 13 | } 14 | 15 | 16 | void CAnimal::Show() 17 | { 18 | cout << name << " " << age << " " << weight << endl; 19 | } 20 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/02zoo-2017-withCZoo/Animal.h: -------------------------------------------------------------------------------- 1 | #ifndef CANIMAL_H 2 | #define CANIMAL_H 3 | 4 | class CAnimal 5 | { 6 | public: 7 | CAnimal(const char *strName="", int a=0, int w=0); 8 | 9 | void Show(); 10 | 11 | private: 12 | char name[32]; 13 | int age; 14 | int weight; 15 | }; 16 | 17 | #endif // CANIMAL_H 18 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/02zoo-2017-withCZoo/Bird.h: -------------------------------------------------------------------------------- 1 | #ifndef CBIRD_H 2 | #define CBIRD_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBird : virtual public CAnimal 7 | { 8 | public: 9 | CBird(const char *strName = "", int a = 0, int w = 0, int ws = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int wingSpan; 16 | }; 17 | 18 | #endif // CBIRD_H 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/02zoo-2017-withCZoo/Bull.h: -------------------------------------------------------------------------------- 1 | #ifndef CBULL_H 2 | #define CBULL_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBull: public CAnimal 7 | { 8 | public: 9 | CBull(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | private: 15 | int power; 16 | }; 17 | 18 | #endif // CBULL_H 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/02zoo-2017-withCZoo/Horse.h: -------------------------------------------------------------------------------- 1 | #ifndef CHORSE_H 2 | #define CHORSE_H 3 | 4 | #include "Animal.h" 5 | 6 | class CHorse : virtual public CAnimal 7 | { 8 | public: 9 | CHorse(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int power; 16 | 17 | }; 18 | 19 | #endif // CHORSE_H 20 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/02zoo-2017-withCZoo/Pegasus.h: -------------------------------------------------------------------------------- 1 | #ifndef CPEGASUS_H 2 | #define CPEGASUS_H 3 | 4 | #include "Horse.h" 5 | #include "Bird.h" 6 | 7 | class CPegasus : public CHorse, public CBird 8 | { 9 | public: 10 | CPegasus(const char *strName="", int a=0, int w=0, int ws=0, int pow=0); 11 | 12 | void Show(); 13 | void Talk(); 14 | 15 | }; 16 | 17 | #endif // CPEGASUS_H 18 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/02zoo-2017-withCZoo/Sound/Bull.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/02zoo-2017-withCZoo/Sound/Bull.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/02zoo-2017-withCZoo/Sound/Eagle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/02zoo-2017-withCZoo/Sound/Eagle.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/02zoo-2017-withCZoo/Sound/Horse.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/02zoo-2017-withCZoo/Sound/Horse.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/02zoo-2017-withCZoo/zoo.depend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/02zoo-2017-withCZoo/zoo.depend -------------------------------------------------------------------------------- /codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Animal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Animal.h" 4 | 5 | using namespace std; 6 | 7 | CAnimal::CAnimal(const char *strName, int a, int w) 8 | { 9 | //ctor 10 | strcpy(name, strName); 11 | age = a; 12 | weight = w; 13 | } 14 | 15 | 16 | void CAnimal::Show() 17 | { 18 | cout << name << " " << age << " " << weight << endl; 19 | } 20 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Animal.h: -------------------------------------------------------------------------------- 1 | #ifndef CANIMAL_H 2 | #define CANIMAL_H 3 | 4 | class CAnimal 5 | { 6 | public: 7 | CAnimal(const char *strName="", int a=0, int w=0); 8 | 9 | void Show(); 10 | 11 | private: 12 | char name[32]; 13 | int age; 14 | int weight; 15 | }; 16 | 17 | #endif // CANIMAL_H 18 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Bird.h: -------------------------------------------------------------------------------- 1 | #ifndef CBIRD_H 2 | #define CBIRD_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBird : virtual public CAnimal 7 | { 8 | public: 9 | CBird(const char *strName = "", int a = 0, int w = 0, int ws = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int wingSpan; 16 | }; 17 | 18 | #endif // CBIRD_H 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Bull.h: -------------------------------------------------------------------------------- 1 | #ifndef CBULL_H 2 | #define CBULL_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBull: public CAnimal 7 | { 8 | public: 9 | CBull(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | private: 15 | int power; 16 | }; 17 | 18 | #endif // CBULL_H 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Horse.h: -------------------------------------------------------------------------------- 1 | #ifndef CHORSE_H 2 | #define CHORSE_H 3 | 4 | #include "Animal.h" 5 | 6 | class CHorse : virtual public CAnimal 7 | { 8 | public: 9 | CHorse(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int power; 16 | 17 | }; 18 | 19 | #endif // CHORSE_H 20 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Pegasus.h: -------------------------------------------------------------------------------- 1 | #ifndef CPEGASUS_H 2 | #define CPEGASUS_H 3 | 4 | #include "Horse.h" 5 | #include "Bird.h" 6 | 7 | class CPegasus : public CHorse, public CBird 8 | { 9 | public: 10 | CPegasus(const char *strName="", int a=0, int w=0, int ws=0, int pow=0); 11 | 12 | void Show(); 13 | void Talk(); 14 | 15 | }; 16 | 17 | #endif // CPEGASUS_H 18 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Sound/Bull.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Sound/Bull.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Sound/Eagle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Sound/Eagle.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Sound/Horse.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Sound/Horse.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/Zoo.h: -------------------------------------------------------------------------------- 1 | #ifndef ZOO_H_INCLUDED 2 | #define ZOO_H_INCLUDED 3 | 4 | class CAnimal; 5 | 6 | const int MAX_ANIM_NUM = 100; 7 | 8 | class CZoo 9 | { 10 | public: 11 | CZoo(); 12 | 13 | void Add(CAnimal *anim); 14 | 15 | void Show(); 16 | void Talk(); 17 | 18 | private: 19 | int size; 20 | CAnimal *m_animal[MAX_ANIM_NUM]; 21 | }; 22 | 23 | 24 | 25 | #endif // ZOO_H_INCLUDED 26 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/zoo.depend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/03zoo-2017-withCZooBasePointer/zoo.depend -------------------------------------------------------------------------------- /codes/chap06/wholecode/04zoo-2017-withVirtualFun/Animal.h: -------------------------------------------------------------------------------- 1 | #ifndef CANIMAL_H 2 | #define CANIMAL_H 3 | 4 | class CAnimal 5 | { 6 | public: 7 | CAnimal(const char *strName="", int a=0, int w=0); 8 | 9 | virtual void Show(); 10 | virtual void Talk(); 11 | 12 | private: 13 | char name[32]; 14 | int age; 15 | int weight; 16 | }; 17 | 18 | #endif // CANIMAL_H 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/04zoo-2017-withVirtualFun/Bird.h: -------------------------------------------------------------------------------- 1 | #ifndef CBIRD_H 2 | #define CBIRD_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBird : virtual public CAnimal 7 | { 8 | public: 9 | CBird(const char *strName = "", int a = 0, int w = 0, int ws = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int wingSpan; 16 | }; 17 | 18 | #endif // CBIRD_H 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/04zoo-2017-withVirtualFun/Bull.h: -------------------------------------------------------------------------------- 1 | #ifndef CBULL_H 2 | #define CBULL_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBull: public CAnimal 7 | { 8 | public: 9 | CBull(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | private: 15 | int power; 16 | }; 17 | 18 | #endif // CBULL_H 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/04zoo-2017-withVirtualFun/Horse.h: -------------------------------------------------------------------------------- 1 | #ifndef CHORSE_H 2 | #define CHORSE_H 3 | 4 | #include "Animal.h" 5 | 6 | class CHorse : virtual public CAnimal 7 | { 8 | public: 9 | CHorse(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int power; 16 | 17 | }; 18 | 19 | #endif // CHORSE_H 20 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/04zoo-2017-withVirtualFun/Pegasus.h: -------------------------------------------------------------------------------- 1 | #ifndef CPEGASUS_H 2 | #define CPEGASUS_H 3 | 4 | #include "Horse.h" 5 | #include "Bird.h" 6 | 7 | class CPegasus : public CHorse, public CBird 8 | { 9 | public: 10 | CPegasus(const char *strName="", int a=0, int w=0, int ws=0, int pow=0); 11 | 12 | void Show(); 13 | void Talk(); 14 | 15 | }; 16 | 17 | #endif // CPEGASUS_H 18 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/04zoo-2017-withVirtualFun/Sound/Bull.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/04zoo-2017-withVirtualFun/Sound/Bull.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/04zoo-2017-withVirtualFun/Sound/Eagle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/04zoo-2017-withVirtualFun/Sound/Eagle.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/04zoo-2017-withVirtualFun/Sound/Horse.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/04zoo-2017-withVirtualFun/Sound/Horse.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/04zoo-2017-withVirtualFun/Zoo.h: -------------------------------------------------------------------------------- 1 | #ifndef ZOO_H_INCLUDED 2 | #define ZOO_H_INCLUDED 3 | 4 | class CAnimal; 5 | 6 | const int MAX_ANIM_NUM = 100; 7 | 8 | class CZoo 9 | { 10 | public: 11 | CZoo(); 12 | 13 | void Add(CAnimal *anim); 14 | 15 | void Show(); 16 | void Talk(); 17 | 18 | private: 19 | int size; 20 | CAnimal *m_animal[MAX_ANIM_NUM]; 21 | }; 22 | 23 | 24 | 25 | #endif // ZOO_H_INCLUDED 26 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/04zoo-2017-withVirtualFun/zoo.depend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/04zoo-2017-withVirtualFun/zoo.depend -------------------------------------------------------------------------------- /codes/chap06/wholecode/05vitualDtor/vitualDtor.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Animal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Animal.h" 4 | 5 | using namespace std; 6 | 7 | CAnimal::CAnimal(const char *strName, int a, int w) 8 | { 9 | //ctor 10 | strcpy(name, strName); 11 | age = a; 12 | weight = w; 13 | } 14 | 15 | void CAnimal::Show() 16 | { 17 | cout << name << " " << age << " " << weight << endl; 18 | } 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Animal.h: -------------------------------------------------------------------------------- 1 | #ifndef CANIMAL_H 2 | #define CANIMAL_H 3 | 4 | class CAnimal 5 | { 6 | public: 7 | CAnimal(const char *strName="", int a=0, int w=0); 8 | 9 | virtual void Show(); 10 | virtual void Talk() = 0; 11 | 12 | private: 13 | char name[32]; 14 | int age; 15 | int weight; 16 | }; 17 | 18 | #endif // CANIMAL_H 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Bird.h: -------------------------------------------------------------------------------- 1 | #ifndef CBIRD_H 2 | #define CBIRD_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBird : virtual public CAnimal 7 | { 8 | public: 9 | CBird(const char *strName = "", int a = 0, int w = 0, int ws = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int wingSpan; 16 | }; 17 | 18 | #endif // CBIRD_H 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Bull.h: -------------------------------------------------------------------------------- 1 | #ifndef CBULL_H 2 | #define CBULL_H 3 | 4 | #include "Animal.h" 5 | 6 | class CBull: public CAnimal 7 | { 8 | public: 9 | CBull(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | private: 15 | int power; 16 | }; 17 | 18 | #endif // CBULL_H 19 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Horse.h: -------------------------------------------------------------------------------- 1 | #ifndef CHORSE_H 2 | #define CHORSE_H 3 | 4 | #include "Animal.h" 5 | 6 | class CHorse : virtual public CAnimal 7 | { 8 | public: 9 | CHorse(const char *strName = "", int a = 0, int w = 0, int pow = 0); 10 | 11 | void Show(); 12 | void Talk(); 13 | 14 | protected: 15 | int power; 16 | 17 | }; 18 | 19 | #endif // CHORSE_H 20 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Pegasus.h: -------------------------------------------------------------------------------- 1 | #ifndef CPEGASUS_H 2 | #define CPEGASUS_H 3 | 4 | #include "Horse.h" 5 | #include "Bird.h" 6 | 7 | class CPegasus : public CHorse, public CBird 8 | { 9 | public: 10 | CPegasus(const char *strName="", int a=0, int w=0, int ws=0, int pow=0); 11 | 12 | void Show(); 13 | void Talk(); 14 | 15 | }; 16 | 17 | #endif // CPEGASUS_H 18 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Sound/Bull.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Sound/Bull.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Sound/Eagle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Sound/Eagle.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Sound/Horse.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Sound/Horse.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/Zoo.h: -------------------------------------------------------------------------------- 1 | #ifndef ZOO_H_INCLUDED 2 | #define ZOO_H_INCLUDED 3 | 4 | class CAnimal; 5 | 6 | const int MAX_ANIM_NUM = 100; 7 | 8 | class CZoo 9 | { 10 | public: 11 | CZoo(); 12 | 13 | void Add(CAnimal *anim); 14 | 15 | void Show(); 16 | void Talk(); 17 | 18 | private: 19 | int size; 20 | CAnimal *m_animal[MAX_ANIM_NUM]; 21 | }; 22 | 23 | 24 | 25 | #endif // ZOO_H_INCLUDED 26 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/zoo.depend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/06zoo-2017-withPureVirtualFun/zoo.depend -------------------------------------------------------------------------------- /codes/chap06/wholecode/07DonutHouse-virtualFun/GlutBasic.depend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/07DonutHouse-virtualFun/GlutBasic.depend -------------------------------------------------------------------------------- /codes/chap06/wholecode/07DonutHouse-virtualFun/Point2D.cpp: -------------------------------------------------------------------------------- 1 | #include "Point2D.h" 2 | -------------------------------------------------------------------------------- /codes/chap06/wholecode/zoosound/Bull.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/zoosound/Bull.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/zoosound/Eagle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/zoosound/Eagle.wav -------------------------------------------------------------------------------- /codes/chap06/wholecode/zoosound/Horse.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap06/wholecode/zoosound/Horse.wav -------------------------------------------------------------------------------- /codes/chap07/01-funtemplate.cpp: -------------------------------------------------------------------------------- 1 | //例07-01;ex07-01.cpp 2 | //求不同类型的两个数之和,演示c++的简单函数模版的定义与使用 3 | #include 4 | 5 | using namespace std; 6 | 7 | template 8 | T1 add(T1 x, T2 y) 9 | { 10 | return x + y; 11 | } 12 | 13 | int main() 14 | { 15 | cout << add(9, 'A') << endl; //隐式实例化 16 | cout << add(9, 'A') << endl; //显式实例化 17 | } 18 | 19 | -------------------------------------------------------------------------------- /codes/chap07/03-operatortemplate.cpp: -------------------------------------------------------------------------------- 1 | //例07-03;ex07-03.cpp 2 | //在模板类的基础上写符号重载函数,演示c++的符号重载函数的书写方法 3 | template 4 | class CSafeArray 5 | { 6 | T a[size]; 7 | public: 8 | CSafeArray() 9 | { 10 | for(int i = 0; i < size; i++) 11 | a[i] = i; 12 | } 13 | T &operator[](int i); 14 | }; 15 | -------------------------------------------------------------------------------- /codes/chap07/04-operatortemplate.cpp: -------------------------------------------------------------------------------- 1 | //例07-04;ex07-04.cpp 2 | //符号重载,演示c++的符号简单重载方法 3 | template 4 | T &CSafeArray::operator[](int i) 5 | { 6 | if(i < 0 || i > size - 1) 7 | { 8 | cout << "Index value of "; 9 | cout << i << " is out-of-bounds.\n"; 10 | exit(1); 11 | } 12 | return a[i]; 13 | } 14 | -------------------------------------------------------------------------------- /codes/chap07/05-templateob1.cpp: -------------------------------------------------------------------------------- 1 | //例07-05;ex07-05.cpp 2 | //在模板类的基础上写符号重载函数, 3 | //演示c++的符号重载函数的书写方法 4 | template 5 | class CSafeArray 6 | { 7 | T a[size]; 8 | public: 9 | CSafeArray() 10 | { 11 | for(int i = 0; i < size; i++) 12 | a[i] = i; 13 | } 14 | T &operator[](int i); 15 | }; 16 | -------------------------------------------------------------------------------- /codes/chap07/05-templateob2.cpp: -------------------------------------------------------------------------------- 1 | //例07-05;ex07-05.cpp 2 | //符号重载函数的写法, 3 | //演示c++的符号重载函数的写法 4 | class CSafeArray 5 | { 6 | int a[10]; 7 | public: 8 | CSafeArray() 9 | { 10 | for(int i = 0; i < 10; i++) 11 | a[i] = i; 12 | } 13 | int &operator[](int i); 14 | }; 15 | -------------------------------------------------------------------------------- /codes/chap07/07-templatedefault-main.cpp: -------------------------------------------------------------------------------- 1 | //例07-07;ex07-07.cpp 2 | //定义模板类的对象,演示c++定义模板类对象的方法 3 | int main() 4 | { 5 | CSafeArray <>intOb; 6 | CSafeArray doubleOb1; 7 | CSafeArray doubleOb2; 8 | } 9 | -------------------------------------------------------------------------------- /codes/chap07/07-templatedefault.cpp: -------------------------------------------------------------------------------- 1 | //例07-07;ex07-07.cpp 2 | //在模板类的基础上写符号重载函数,演示c++的符号重载函数的书写方法 3 | template 4 | class CSafeArray 5 | { 6 | T a[size]; 7 | public: 8 | CSafeArray() 9 | { 10 | int i; 11 | for(i = 0; i < size; i++) 12 | a[i] = i; 13 | } 14 | T &operator[](int i); 15 | }; 16 | -------------------------------------------------------------------------------- /codes/chap07/08-stack-class.cpp: -------------------------------------------------------------------------------- 1 | //例07-08;ex07-08.cpp 2 | //定义一个栈类 3 | const int SIZE = 10; 4 | 5 | template 6 | class stack 7 | { 8 | ST s[SIZE]; // holds the stack 9 | int top; // index of top-of-stack 10 | public: 11 | stack() 12 | { 13 | top = 0; // initialize stack 14 | } 15 | 16 | void Push(ST ob); // push object on stack 17 | ST Pop(); // pop object from stack 18 | }; 19 | -------------------------------------------------------------------------------- /codes/chap07/08-stack-fun-pop.cpp: -------------------------------------------------------------------------------- 1 | //例07-08;ex07-08.cpp 2 | //定义一个出栈函数 3 | // Pop an object. 4 | template 5 | ST stack::Pop() 6 | { 7 | if(top == 0) 8 | { 9 | cout << "Stack is empty.\n"; 10 | return 0; 11 | } 12 | top--; 13 | return s[top]; 14 | } 15 | -------------------------------------------------------------------------------- /codes/chap07/08-stack-fun-push.cpp: -------------------------------------------------------------------------------- 1 | //例07-08;ex07-08.cpp 2 | //定义一个入栈函数 3 | // Push an object. 4 | template 5 | void stack::Push(ST ob) 6 | { 7 | if(top == SIZE) 8 | { 9 | cout << "Stack is full.\n"; 10 | return; 11 | } 12 | s[top] = ob; 13 | top++; 14 | } 15 | -------------------------------------------------------------------------------- /codes/chap07/12-deque01.cpp: -------------------------------------------------------------------------------- 1 | //例07-12;ex07-12.cpp 2 | //容器deque的使用,演示c++中容器deque的简单函数使用 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | deque dv; 10 | 11 | for (int i = 0; i < 6; ++i) 12 | { 13 | dv.push_front(i * 1.1); 14 | } 15 | 16 | for (int i = 0; i < dv.size(); ++i) 17 | cout << dv[i] << ' '; 18 | cout << endl; 19 | 20 | return 0; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /codes/chap07/14-iterator01.cpp: -------------------------------------------------------------------------------- 1 | //例07-14;ex07-14.cpp 2 | //容器vector的反向迭代器的使用,演示c++中容器vector中反向迭代器的使用 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | int main() 9 | { 10 | vector v; 11 | vector ::reverse_iterator p; 12 | 13 | for(int i = 0; i < 10; i++) 14 | v.push_back(i); 15 | 16 | for(p = v.rbegin(); p != v.rend(); p++) 17 | cout << *p << " "; 18 | cout << endl; 19 | } 20 | -------------------------------------------------------------------------------- /codes/chap07/15-itertempfind.cpp: -------------------------------------------------------------------------------- 1 | //例07-15;ex07-15.cpp 2 | //在容器vector上定义寻找函数FIND来 3 | //获得数value在容器vector中的位置 4 | template 5 | ITER Find(ITER first, ITER last, T value) 6 | { 7 | while(first != last && *first != value) 8 | ++first; 9 | return first; 10 | } 11 | -------------------------------------------------------------------------------- /codes/chap07/15-itertempprint.cpp: -------------------------------------------------------------------------------- 1 | //例07-15;ex07-15.cpp 2 | //容器vector上定义输出函数 3 | template 4 | void Print(ITER first, ITER last) 5 | { 6 | while(first != last) 7 | { 8 | cout << *first << " "; 9 | ++first; 10 | } 11 | cout << endl; 12 | } 13 | -------------------------------------------------------------------------------- /codes/chap07/16-find.cpp: -------------------------------------------------------------------------------- 1 | //例07-16;ex07-16.cpp 2 | //定义寻找函数find来获得数value所在的位置 3 | template 4 | InputIterator find( InputIterator first, InputIterator last, const T& value ) 5 | { 6 | for ( ; first != last; first++) if ( *first == value ) break; 7 | return first; 8 | } 9 | -------------------------------------------------------------------------------- /codes/chap07/17-foreach.cpp: -------------------------------------------------------------------------------- 1 | //例07-15;ex07-15.cpp 2 | //定义for_each函数,使得在first与last之间的元素都做f处理 3 | template 4 | Function for_each(InputIterator first, InputIterator last, Function f) 5 | { 6 | for ( ; first != last; ++first ) f(*first); 7 | return f; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /codes/chap07/30-funobjgreater.cpp: -------------------------------------------------------------------------------- 1 | //例07-30;ex07-30.cpp 2 | //数组排序,演示c++中sort函数的使用 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | int main () 9 | { 10 | int numbers[] = {20, 40, 50, 10, 30}; 11 | sort (numbers, numbers + 5, greater() ); 12 | for (int i = 0; i < 5; i++) 13 | cout << numbers[i] << " "; 14 | cout << endl; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/Letc07.workspace.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/ex-src.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap07/CB-Projector-Codes/ex-src.zip -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testExportCompile/safearray.cpp: -------------------------------------------------------------------------------- 1 | #include "safearray.h" 2 | 3 | template 4 | T &CSafeArray::operator[](int i) 5 | { 6 | if(i < 0 || i > size - 1) 7 | { 8 | cout << "Index value of "; 9 | cout << i << " is out-of-bounds.\n"; 10 | exit(1); 11 | } 12 | return a[i]; 13 | } 14 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testFunTemplate/main.cpp: -------------------------------------------------------------------------------- 1 | //求不同类型的两个数之和,演示c++的简单函数模版的定义与使用 2 | #include 3 | 4 | using namespace std; 5 | 6 | template 7 | T1 add(T1 x, T2 y) 8 | { 9 | return x + y; 10 | } 11 | 12 | int main() 13 | { 14 | cout << add(9, 'A') << endl; //隐式实例化 15 | cout << add(9, 'A') << endl; //显式实例化 16 | } 17 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testFunTemplate/testFunTemplate.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLALgFind/testSTLALgFind.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgBiSearch/testSTLAlgBiSearch.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1497238611 source:/home/registor/Desktop/testCPP/Lect07-CalssTemplate-STL/testSTLAlgBiSearch/main.cpp 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgBiSearch/testSTLAlgBiSearch.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgForeach/testSTLAlgForeach.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgFunObj01/testSTLAlgFunObj.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgFunObj01/testSTLAlgFunObj01.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgFunObj02/testSTLAlgFunObj02.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgFunObj03/testSTLAlgFunObj03.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgFunObjGreater/main.cpp: -------------------------------------------------------------------------------- 1 | //数组排序,演示c++中sort函数的使用 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | int main () 9 | { 10 | int numbers[] = {20, 40, 50, 10, 30}; 11 | 12 | sort (numbers, numbers + 5, greater() ); 13 | 14 | for (int i = 0; i < 5; i++) 15 | cout << numbers[i] << " "; 16 | cout << endl; 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgFunObjPlus/testSTLAlgFunObjPlus.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgRemove/testSTLAlgRemove.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1497238121 source:/home/registor/Desktop/testCPP/Lect07-CalssTemplate-STL/testSTLAlgRemove/main.cpp 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgRemove/testSTLAlgRemove.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgReplace/testSTLAlgReplace.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgSort01/testSTLAlgSort01.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgSort02/testSTLAlgSort02.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1497238306 source:/home/registor/Desktop/testCPP/Lect07-CalssTemplate-STL/testSTLAlgSort02/main.cpp 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgSort02/testSTLAlgSort02.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLAlgSortHeap/testSTLAlgSortHeap.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLCountIf/testSTLCountIf.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLDeque01/main.cpp: -------------------------------------------------------------------------------- 1 | //容器deque的使用,演示c++中容器deque的简单函数使用 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | deque dv; 10 | 11 | for (int i = 0; i < 6; ++i) 12 | { 13 | dv.push_front(i * 1.1); 14 | } 15 | 16 | for (unsigned int i = 0; i < dv.size(); ++i) 17 | cout << dv[i] << ' '; 18 | 19 | cout << endl; 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLDeque01/testSTLDeque01.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLDeque02/testSTLDeque02.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLIterTemplate/testSTLIterTemplate.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLIterator/main.cpp: -------------------------------------------------------------------------------- 1 | //容器vector的反向迭代器的使用,演示c++中容器vector中反向迭代器的使用 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | vector v; 10 | vector ::reverse_iterator p; 11 | 12 | for(int i = 0; i < 10; i++) 13 | v.push_back(i); 14 | 15 | for(p = v.rbegin(); p != v.rend(); p++) 16 | cout << *p << " "; 17 | cout << endl; 18 | } 19 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLIterator/testSTLIterator.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLList01/testSTLList01.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLList02/testSTLList02.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLVector01/testSTLVector01.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSTLVector02/testSTLVector02.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSafeArray/testSafeArray.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSafeArrayFunTemplate/testSafeArrayFunTemplate.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1497230253 source:/home/registor/Desktop/testCPP/Lect07-CalssTemplate-STL/testSafeArrayFunTemplate/main.cpp 3 | 4 | 5 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testSafeArrayFunTemplate/testSafeArrayFunTemplate.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/chap07/CB-Projector-Codes/testStackTemplate/testStackTemplate.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap07/code/01-funtemplate.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | template 6 | T1 add(T1 x, T2 y) 7 | { 8 | return x + y; 9 | } 10 | 11 | int main() 12 | { 13 | cout << add(9, 'A') << endl; 14 | cout << add(9, 'A') << endl; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /codes/chap07/code/05-vector01.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | vector v; 9 | 10 | for (int i = 0; i < 6; ++i) 11 | v.push_back(i); 12 | 13 | for (int i = 0; i < 3; ++i) 14 | v.pop_back(); 15 | 16 | for (int i = 0; i < (int)v.size( ); ++i) 17 | cout << v[i] << ' '; 18 | cout << endl; 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /codes/chap07/code/06-vector02.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | vector v(6,1); 9 | 10 | for (int i=0; i 2 | #include 3 | using namespace std; 4 | 5 | int main() 6 | { 7 | deque dv; 8 | 9 | for (int i = 0; i < 6; ++i) 10 | { 11 | dv.push_front(i * 1.1); 12 | } 13 | 14 | for (int i = 0; i < dv.size(); ++i) 15 | cout << dv[i] << ' '; 16 | cout << endl; 17 | 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /codes/chap07/code/10-iterator01.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | vector v; 9 | vector ::reverse_iterator p; 10 | 11 | for(int i = 0; i < 10; i++) 12 | v.push_back(i); 13 | 14 | for(p = v.rbegin(); p != v.rend(); p++) 15 | cout << *p << " "; 16 | cout << endl; 17 | } 18 | -------------------------------------------------------------------------------- /codes/chap07/code/30-funobjgreater.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | int main () 7 | { 8 | int numbers[] = {20, 40, 50, 10, 30}; 9 | sort (numbers, numbers + 5, greater() ); 10 | for (int i = 0; i < 5; i++) 11 | cout << numbers[i] << " "; 12 | cout << endl; 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /codes/chap07/code/31-funobjlogicalnot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main () 5 | { 6 | bool values[] = {true, false}; 7 | bool result[2]; 8 | 9 | transform (values, values + 2, result, logical_not() ); 10 | cout << boolalpha << "Logical NOT:\n"; 11 | 12 | for (int i = 0; i < 2; i++) 13 | cout << "NOT " << values[i] << " = " << result[i] << "\n"; 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /codes/chap07/code/chap07code.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap07/code/chap07code.zip -------------------------------------------------------------------------------- /codes/chap08/01-fomat01.cpp: -------------------------------------------------------------------------------- 1 | // 例01-fomat01:ex01-fomat01.cpp 2 | // c++ 输出控制的演示 3 | 4 | #include 5 | 6 | using namespace std; 7 | 8 | int main() 9 | { 10 | char buff[11] = "0123456789"; 11 | 12 | cout << buff << endl; 13 | 14 | for (int i = 0; i < 10; i++) 15 | cout.put(buff[i]); 16 | cout << endl; 17 | 18 | cout.write(buff, 10); 19 | cout << endl; 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /codes/chap08/code/01-fomat01.cpp: -------------------------------------------------------------------------------- 1 | // 例01-fomat01:ex01-fomat01.cpp 2 | // c++ 输出控制的演示 3 | 4 | #include 5 | 6 | using namespace std; 7 | 8 | int main() 9 | { 10 | char buff[11] = "0123456789"; 11 | 12 | cout << buff << endl; 13 | 14 | for (int i = 0; i < 10; i++) 15 | cout.put(buff[i]); 16 | cout << endl; 17 | 18 | cout.write(buff, 10); 19 | cout << endl; 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /codes/chap08/testBiFileRead/record.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap08/testBiFileRead/record.bin -------------------------------------------------------------------------------- /codes/chap08/testBiFileRead/testBiFileRead.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testFileMergin/testFileMergin.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1467100724 source:f:\testcpp\testiostream\testfilemergin\main.cpp 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /codes/chap08/testFileMergin/testFileMergin.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testFileMerginSort/03-printfilefun.cpp: -------------------------------------------------------------------------------- 1 | void PrintFile(char *fileName, const list &buff) 2 | { 3 | list ::const_iterator it; 4 | ofstream outFile(fileName); 5 | 6 | if(!outFile) return; 7 | for (it = buff.begin(); it != buff.end(); it++) 8 | { 9 | outFile << it->ID << "\t" << it->name << "\t" 10 | << it->univ << "\t" << it->score << endl; 11 | } 12 | outFile.close(); 13 | } 14 | -------------------------------------------------------------------------------- /codes/chap08/testFileMerginSort/first.txt: -------------------------------------------------------------------------------- 1 | James 10001 CMU 600 2 | John 10003 Stanford 580 3 | John 10003 Stanford 580 4 | Barbara 10006 UCB 578 5 | Alice 10002 MIT 595 6 | exit 7 | -------------------------------------------------------------------------------- /codes/chap08/testFileMerginSort/result.txt: -------------------------------------------------------------------------------- 1 | 10001 James CMU 600 2 | 10002 Alice MIT 595 3 | 10003 John Stanford 580 4 | 10006 Barbara UCB 578 5 | 10007 William Princeton 572 6 | 10009 Susan GIT 553 7 | -------------------------------------------------------------------------------- /codes/chap08/testFileMerginSort/second.txt: -------------------------------------------------------------------------------- 1 | Susan 10009 GIT 553 2 | William 10007 Princeton 572 3 | Susan 10009 GIT 553 4 | exit 5 | -------------------------------------------------------------------------------- /codes/chap08/testFileMerginSort/testFileMerginSort.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testFormat/testFormat.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testFormat02/testFormat02.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testGet/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | int main() 5 | { 6 | char c; 7 | 8 | while ( (c = cin.get()) != '\n' ) 9 | cout.put(c); 10 | 11 | cout << endl ; 12 | 13 | char s[ 80 ] ; 14 | cin.get(s, 10) ; 15 | cout << s << endl ; 16 | } 17 | -------------------------------------------------------------------------------- /codes/chap08/testGet/testGet.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testGetline/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | int main() 5 | { 6 | const int max_len = 256; 7 | char line[max_len]; 8 | int i=0; 9 | 10 | while ( (cin.getline(line, max_len))) 11 | { 12 | cout << "[" << i << "]:" << line << endl;; 13 | i++; 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /codes/chap08/testGetline/testGetline.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testGetline02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | int main() 5 | { 6 | const int max_len = 256; 7 | char line[max_len]; 8 | int i=0; 9 | 10 | while ( (cin.getline(line, max_len, ','))) 11 | { 12 | cout << "[" << i << "]:" << line << endl;; 13 | i++; 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /codes/chap08/testGetline02/testGetline02.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testIOFlag/testIOFlag.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1467099535 source:f:\testcpp\testiostream\testioflag\main.cpp 3 | 4 | 5 | -------------------------------------------------------------------------------- /codes/chap08/testIOFlag/testIOFlag.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testIOStream.workspace.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /codes/chap08/testImageReadWrite/Lighthouse.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap08/testImageReadWrite/Lighthouse.bmp -------------------------------------------------------------------------------- /codes/chap08/testImageReadWrite/Penguins.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap08/testImageReadWrite/Penguins.bmp -------------------------------------------------------------------------------- /codes/chap08/testImageReadWrite/Result.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap08/testImageReadWrite/Result.bmp -------------------------------------------------------------------------------- /codes/chap08/testImageReadWrite/testImageReadWrite.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1467101619 source:f:\testcpp\testiostream\testimagereadwrite\main.cpp 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/chap08/testImageReadWrite/testImageReadWrite.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testTXTRead/record.txt: -------------------------------------------------------------------------------- 1 | hello 89 2 | c 89 3 | sdf 96 4 | -------------------------------------------------------------------------------- /codes/chap08/testTXTRead/testTXTRead.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testTXTWrite/record.txt: -------------------------------------------------------------------------------- 1 | hello 89 2 | c 89 3 | sdf 96 4 | -------------------------------------------------------------------------------- /codes/chap08/testTXTWrite/testTXTWrite.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testbiFileWrite/record.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/codes/chap08/testbiFileWrite/record.bin -------------------------------------------------------------------------------- /codes/chap08/testbiFileWrite/testbiFileWrite.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap08/testcout01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | int main() 6 | { 7 | char buff[11] = "0123456789"; 8 | 9 | cout << buff << endl; 10 | 11 | for (int i=0; i<10; i++) 12 | cout.put(buff[i]); 13 | cout << endl; 14 | 15 | cout.write(buff,10); 16 | cout << endl; 17 | return 0; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /codes/chap08/testcout01/testcout01.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1467099352 source:f:\testcpp\testiostream\testcout01\main.cpp 3 | 4 | 5 | -------------------------------------------------------------------------------- /codes/chap08/testcout01/testcout01.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap09/testItoa/testItoa.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap09/teststrAlgo/teststrAlgo.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap09/teststrAtoi/main (复件).cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | int year, month, day; 10 | string strDate = "2010 12 31"; 11 | istringstream streamInfo(strDate); 12 | streamInfo >> year >> month >> day; 13 | cout << year << month << day; 14 | return 0; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /codes/chap09/teststrAtoi/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | int year, month, day; 10 | string strDate = "2010 12 31"; 11 | istringstream streamInfo(strDate); 12 | streamInfo >> year >> month >> day; 13 | cout << year << month << day; 14 | return 0; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /codes/chap09/teststrAtoi/main2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | int year, month, day; 10 | string strDate = "2010 12 31"; 11 | istringstream streamInfo(strDate); 12 | streamInfo >> year >> month >> day; 13 | cout << year << month << day; 14 | return 0; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /codes/chap09/teststrAtoi/teststrAtoi.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap09/teststrGetWord/teststrGetWord.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap09/teststrOperator/teststrOperator.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap09/teststrfindreplace/teststrfindreplace.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap09/teststring.workspace.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /codes/chap09/teststring01/teststring01.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap09/teststrreplace/teststrreplace.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1467102307 source:f:\testcpp\teststring\teststrreplace\main.cpp 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/chap09/teststrreplace/teststrreplace.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap10/testTryCatch01/testTryCatch01.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/chap10/testexception.workspace.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /codes/chap10/testfileexception/test.txt: -------------------------------------------------------------------------------- 1 | dfsaf;asdfds 2 | -------------------------------------------------------------------------------- /codes/chap10/testfileexception/testfileexception.depend: -------------------------------------------------------------------------------- 1 | # depslib dependency file v1.0 2 | 1467103456 source:f:\testcpp\testexception\testfileexception\main.cpp 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/chap10/testfileexception/testfileexception.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demos/Lect00-Intro.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/demos/Lect00-Intro.pdf -------------------------------------------------------------------------------- /demos/Lect01-Base .pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/demos/Lect01-Base .pdf -------------------------------------------------------------------------------- /demos/Lect02-C2CPP.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/demos/Lect02-C2CPP.pdf -------------------------------------------------------------------------------- /demos/Lect03-Class.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/demos/Lect03-Class.pdf -------------------------------------------------------------------------------- /demos/Lect04-OperatorOverload.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/demos/Lect04-OperatorOverload.pdf -------------------------------------------------------------------------------- /demos/Lect05-Inherit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/demos/Lect05-Inherit.pdf -------------------------------------------------------------------------------- /demos/Lect06-VirtualFun.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/demos/Lect06-VirtualFun.pdf -------------------------------------------------------------------------------- /demos/Lect07-ClassTemplate-STL.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/demos/Lect07-ClassTemplate-STL.pdf -------------------------------------------------------------------------------- /demos/Lect08-IO-Stream.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/demos/Lect08-IO-Stream.pdf -------------------------------------------------------------------------------- /demos/Lect09-string-Class.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/demos/Lect09-string-Class.pdf -------------------------------------------------------------------------------- /demos/Lect10-exception try-catch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/demos/Lect10-exception try-catch.pdf -------------------------------------------------------------------------------- /ex-src01.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/ex-src01.zip -------------------------------------------------------------------------------- /ex-src02.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/ex-src02.zip -------------------------------------------------------------------------------- /ex-src03.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/ex-src03.zip -------------------------------------------------------------------------------- /ex-src04.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/ex-src04.zip -------------------------------------------------------------------------------- /ex-src05.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/ex-src05.zip -------------------------------------------------------------------------------- /ex-src06.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/ex-src06.zip -------------------------------------------------------------------------------- /ex-src07.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/ex-src07.zip -------------------------------------------------------------------------------- /ex-src08.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/ex-src08.zip -------------------------------------------------------------------------------- /ex-src09.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/ex-src09.zip -------------------------------------------------------------------------------- /ex-src10.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/ex-src10.zip -------------------------------------------------------------------------------- /figure/chap00/01textbook.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap00/01textbook.jpg -------------------------------------------------------------------------------- /figure/chap00/02primerplus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap00/02primerplus.jpg -------------------------------------------------------------------------------- /figure/chap00/02primerpluszh.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap00/02primerpluszh.jpg -------------------------------------------------------------------------------- /figure/chap00/02programming.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap00/02programming.jpg -------------------------------------------------------------------------------- /figure/chap00/03programming.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap00/03programming.jpg -------------------------------------------------------------------------------- /figure/chap00/04primerpluszh.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap00/04primerpluszh.jpg -------------------------------------------------------------------------------- /figure/chap00/CHTP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap00/CHTP.jpg -------------------------------------------------------------------------------- /figure/chap00/CHTP9e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap00/CHTP9e.jpg -------------------------------------------------------------------------------- /figure/chap00/PAinCPP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap00/PAinCPP.jpg -------------------------------------------------------------------------------- /figure/chap00/oopmindmap.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap00/oopmindmap.pdf -------------------------------------------------------------------------------- /figure/chap00/studyscheme-tem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap00/studyscheme-tem.png -------------------------------------------------------------------------------- /figure/chap00/studyscheme.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap00/studyscheme.pdf -------------------------------------------------------------------------------- /figure/chap01/01trees.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/01trees.png -------------------------------------------------------------------------------- /figure/chap01/02treesgrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/02treesgrow.png -------------------------------------------------------------------------------- /figure/chap01/03treesseason.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/03treesseason.png -------------------------------------------------------------------------------- /figure/chap01/04tetrogame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/04tetrogame.png -------------------------------------------------------------------------------- /figure/chap01/05tetroobj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/05tetroobj.png -------------------------------------------------------------------------------- /figure/chap01/06tetromove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/06tetromove.png -------------------------------------------------------------------------------- /figure/chap01/07abstraction01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/07abstraction01.png -------------------------------------------------------------------------------- /figure/chap01/07abstraction02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/07abstraction02.png -------------------------------------------------------------------------------- /figure/chap01/07abstraction03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/07abstraction03.png -------------------------------------------------------------------------------- /figure/chap01/07abstraction04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/07abstraction04.jpg -------------------------------------------------------------------------------- /figure/chap01/08encap01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/08encap01.jpg -------------------------------------------------------------------------------- /figure/chap01/08encap02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/08encap02.jpg -------------------------------------------------------------------------------- /figure/chap01/09inherit01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/09inherit01.jpg -------------------------------------------------------------------------------- /figure/chap01/09inherit02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/09inherit02.jpg -------------------------------------------------------------------------------- /figure/chap01/09inherit02.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/09inherit02.xcf -------------------------------------------------------------------------------- /figure/chap01/10lispauthor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/10lispauthor.jpg -------------------------------------------------------------------------------- /figure/chap01/11simulaauthor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/11simulaauthor.png -------------------------------------------------------------------------------- /figure/chap01/12smalltalkauthor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/12smalltalkauthor.jpg -------------------------------------------------------------------------------- /figure/chap01/13cauthor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/13cauthor.jpg -------------------------------------------------------------------------------- /figure/chap01/14cppauthor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/14cppauthor.jpg -------------------------------------------------------------------------------- /figure/chap01/15javaauthor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/15javaauthor.png -------------------------------------------------------------------------------- /figure/chap01/16cppauthor2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/16cppauthor2.png -------------------------------------------------------------------------------- /figure/chap01/17idedevc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/17idedevc.png -------------------------------------------------------------------------------- /figure/chap01/18idevs2005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/18idevs2005.png -------------------------------------------------------------------------------- /figure/chap01/19idecb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/19idecb.png -------------------------------------------------------------------------------- /figure/chap01/20ideqt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap01/20ideqt.png -------------------------------------------------------------------------------- /figure/chap02/01cppoutput01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap02/01cppoutput01.png -------------------------------------------------------------------------------- /figure/chap02/01cppoutput02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap02/01cppoutput02.png -------------------------------------------------------------------------------- /figure/chap02/02cast.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap02/02cast.pdf -------------------------------------------------------------------------------- /figure/chap02/03funasm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap02/03funasm.pdf -------------------------------------------------------------------------------- /figure/chap02/04inlinetest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap02/04inlinetest.png -------------------------------------------------------------------------------- /figure/chap02/05externkeyword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap02/05externkeyword.png -------------------------------------------------------------------------------- /figure/chap02/06statickeyword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap02/06statickeyword.png -------------------------------------------------------------------------------- /figure/chap03/00graph2dcoord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/00graph2dcoord.png -------------------------------------------------------------------------------- /figure/chap03/01graph2dcoord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/01graph2dcoord.png -------------------------------------------------------------------------------- /figure/chap03/01thispointor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/01thispointor.png -------------------------------------------------------------------------------- /figure/chap03/02graph2dinstall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/02graph2dinstall.png -------------------------------------------------------------------------------- /figure/chap03/03graph2dCBsetting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/03graph2dCBsetting.png -------------------------------------------------------------------------------- /figure/chap03/04graph2d1stpic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/04graph2d1stpic.png -------------------------------------------------------------------------------- /figure/chap03/05graph2d2ndpic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/05graph2d2ndpic.png -------------------------------------------------------------------------------- /figure/chap03/06objsmemaddr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/06objsmemaddr.png -------------------------------------------------------------------------------- /figure/chap03/07ctorsequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/07ctorsequence.png -------------------------------------------------------------------------------- /figure/chap03/cppg2d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/cppg2d.png -------------------------------------------------------------------------------- /figure/chap03/cppg2dwizard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/cppg2dwizard.png -------------------------------------------------------------------------------- /figure/chap03/freeglut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/freeglut.png -------------------------------------------------------------------------------- /figure/chap03/leopard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap03/leopard.png -------------------------------------------------------------------------------- /figure/chap04/01tiananmen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap04/01tiananmen.png -------------------------------------------------------------------------------- /figure/chap04/02nwsuaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap04/02nwsuaf.png -------------------------------------------------------------------------------- /figure/chap05/01MFC01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/01MFC01.png -------------------------------------------------------------------------------- /figure/chap05/01MFC02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/01MFC02.png -------------------------------------------------------------------------------- /figure/chap05/01MFC03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/01MFC03.png -------------------------------------------------------------------------------- /figure/chap05/01qt42classchart.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/01qt42classchart.pdf -------------------------------------------------------------------------------- /figure/chap05/02qt42.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/02qt42.pdf -------------------------------------------------------------------------------- /figure/chap05/02qt43classchart.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/02qt43classchart.pdf -------------------------------------------------------------------------------- /figure/chap05/03-01drawbox.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/03-01drawbox.jpg -------------------------------------------------------------------------------- /figure/chap05/03-02linebox.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/03-02linebox.jpg -------------------------------------------------------------------------------- /figure/chap05/03-03shapebox.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/03-03shapebox.jpg -------------------------------------------------------------------------------- /figure/chap05/03mfc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/03mfc.gif -------------------------------------------------------------------------------- /figure/chap05/04shapefig.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/04shapefig.jpg -------------------------------------------------------------------------------- /figure/chap05/05ctorinit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/05ctorinit.jpg -------------------------------------------------------------------------------- /figure/chap05/06-01horse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/06-01horse.jpg -------------------------------------------------------------------------------- /figure/chap05/06-02bird.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/06-02bird.jpg -------------------------------------------------------------------------------- /figure/chap05/06-03horsebird.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/06-03horsebird.jpg -------------------------------------------------------------------------------- /figure/chap05/07-multiInheritCtor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/07-multiInheritCtor.jpg -------------------------------------------------------------------------------- /figure/chap05/08-ambiguous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/08-ambiguous.png -------------------------------------------------------------------------------- /figure/chap05/09-ctor-ambiguous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/09-ctor-ambiguous.png -------------------------------------------------------------------------------- /figure/chap05/10-virtualctor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap05/10-virtualctor.png -------------------------------------------------------------------------------- /figure/chap06/01bird.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap06/01bird.jpg -------------------------------------------------------------------------------- /figure/chap06/02horse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap06/02horse.jpg -------------------------------------------------------------------------------- /figure/chap06/03pegasus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap06/03pegasus.jpg -------------------------------------------------------------------------------- /figure/chap06/04bull.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap06/04bull.jpg -------------------------------------------------------------------------------- /figure/chap06/05virtualfunerror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap06/05virtualfunerror.png -------------------------------------------------------------------------------- /figure/chap06/06novdtor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap06/06novdtor.png -------------------------------------------------------------------------------- /figure/chap06/07vdtor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap06/07vdtor.png -------------------------------------------------------------------------------- /figure/chap06/08abstractobj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap06/08abstractobj.png -------------------------------------------------------------------------------- /figure/chap06/09shapehouse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap06/09shapehouse.jpg -------------------------------------------------------------------------------- /figure/chap06/10rtti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap06/10rtti.png -------------------------------------------------------------------------------- /figure/chap07/01stack01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/01stack01.png -------------------------------------------------------------------------------- /figure/chap07/01stack02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/01stack02.png -------------------------------------------------------------------------------- /figure/chap07/02stl01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/02stl01.png -------------------------------------------------------------------------------- /figure/chap07/02stl02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/02stl02.png -------------------------------------------------------------------------------- /figure/chap07/02stl03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/02stl03.png -------------------------------------------------------------------------------- /figure/chap07/02stl04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/02stl04.png -------------------------------------------------------------------------------- /figure/chap07/03stl05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/03stl05.png -------------------------------------------------------------------------------- /figure/chap07/04stl0container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/04stl0container.png -------------------------------------------------------------------------------- /figure/chap07/05stltimeO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/05stltimeO.png -------------------------------------------------------------------------------- /figure/chap07/06queue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/06queue.png -------------------------------------------------------------------------------- /figure/chap07/07stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/07stack.png -------------------------------------------------------------------------------- /figure/chap07/08iterator01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/08iterator01.png -------------------------------------------------------------------------------- /figure/chap07/08iterator2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/08iterator2.png -------------------------------------------------------------------------------- /figure/chap07/09stlsort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/09stlsort.png -------------------------------------------------------------------------------- /figure/chap07/10heap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/10heap.png -------------------------------------------------------------------------------- /figure/chap07/11tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/11tree.png -------------------------------------------------------------------------------- /figure/chap07/12boost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap07/12boost.png -------------------------------------------------------------------------------- /figure/chap08/01inputdevice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap08/01inputdevice.png -------------------------------------------------------------------------------- /figure/chap08/02mem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap08/02mem.png -------------------------------------------------------------------------------- /figure/chap08/03outputdevice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap08/03outputdevice.png -------------------------------------------------------------------------------- /figure/chap08/04charset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap08/04charset.png -------------------------------------------------------------------------------- /figure/chap08/05fomatflag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap08/05fomatflag.png -------------------------------------------------------------------------------- /figure/chap10/01trycatchclass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/chap10/01trycatchclass.png -------------------------------------------------------------------------------- /figure/nwsuaflogobar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/nwsuaflogobar.png -------------------------------------------------------------------------------- /figure/nwsuaflogobk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/nwsuaflogobk.png -------------------------------------------------------------------------------- /figure/nwsuaflogoc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/nwsuaflogoc.pdf -------------------------------------------------------------------------------- /figure/nwsuaflogoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/nwsuaflogoc.png -------------------------------------------------------------------------------- /figure/pdfattatchdownload01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/pdfattatchdownload01.png -------------------------------------------------------------------------------- /figure/pdfattatchdownload02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/pdfattatchdownload02.png -------------------------------------------------------------------------------- /figure/pdfattatchdownload03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/pdfattatchdownload03.png -------------------------------------------------------------------------------- /figure/pdfattatchdownload04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/figure/pdfattatchdownload04.png -------------------------------------------------------------------------------- /main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/main.pdf -------------------------------------------------------------------------------- /nwafulogo/cir_bar_h_w.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/nwafulogo/cir_bar_h_w.pdf -------------------------------------------------------------------------------- /nwafulogo/circle.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/nwafulogo/circle.pdf -------------------------------------------------------------------------------- /nwafulogo/h_bar.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/nwafulogo/h_bar.pdf -------------------------------------------------------------------------------- /nwafulogo/nwafu_logo_cie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/nwafulogo/nwafu_logo_cie.png -------------------------------------------------------------------------------- /nwafulogo/nwafu_waves.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/nwafulogo/nwafu_waves.pdf -------------------------------------------------------------------------------- /screenshots/00cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/screenshots/00cover.png -------------------------------------------------------------------------------- /screenshots/00cover2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/screenshots/00cover2.png -------------------------------------------------------------------------------- /screenshots/01withclock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/screenshots/01withclock.png -------------------------------------------------------------------------------- /screenshots/01withclock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/screenshots/01withclock2.png -------------------------------------------------------------------------------- /screenshots/02tikzfig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/screenshots/02tikzfig.png -------------------------------------------------------------------------------- /screenshots/02tikzfig2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/screenshots/02tikzfig2.png -------------------------------------------------------------------------------- /screenshots/03UML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/screenshots/03UML.png -------------------------------------------------------------------------------- /screenshots/03UML2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/registor/cpplects-beamer/922924de81ac093a4becd4f4f4fe1db114aeb05d/screenshots/03UML2.png --------------------------------------------------------------------------------