摘要:
好久没更博了,最近在忙着各种期中考试 在这里发一下我的python结课大作业的代码把,是一个类似于“打飞机”的弹球游戏,要在大量球的反弹中不被撞击活下来并且发射子弹攻击球,还是有点难度的hahahahaha 附上一张游戏图片: 阅读全文
摘要:
Noteworthy: 1 constructors of the derived class use member initializer list syntax to initialize base class private members: 2 A derived class method 阅读全文
摘要:
class inheritance lets you derive new classes from old ones, inheriting its properties of the old class, called the base class With inheritance, you c 阅读全文
摘要:
12.7 A queue simulation ) queue: FIFO(first in first out), just like regular queue in the waiting line ) stack: LIFO(last in first out), just like a p 阅读全文
摘要:
12.3 Things to remember when using new in constructors ) If you use new in constructors, use delete in destructor. Their use should be compatible, pai 阅读全文
摘要:
12.1 Dynamic memory and classes 12.1.1 A review example and static class members Now try implement a String class(a flawed one): // sayings1.cpp using 阅读全文
摘要:
11.5.3 An implementation comment ) The separation of interface from implementation is one of the goals of OOP. ) Example of the implementation of the 阅读全文
摘要:
11.1 Operator overloading ) Operator overloading is an example of C++ polymorphism. It allows you to extend operator overloading to user defined types 阅读全文
摘要:
10.5 An array of objects ) You can define an array of objects just as an array of built in types: Declaring without initialization requires the class 阅读全文
摘要:
10.2.4 Using classes Following exapmle uses the class definition and implementation written in previous files: ) The code below is a client: client : 阅读全文