2011款飞度 清洗:notes for C++ tutorial for C users

来源:百度文库 编辑:偶看新闻 时间:2024/04/30 15:48:20
C++   简单的语法上的介绍。

1. static
One or more variables in a class can be declared static.In which case, only one instance of those variables exist, shared byall instancesof the class. It must be initialised outside the classdeclaration :

2. const
A class variable can also be constant. That'sjust like static, except it is given a value inside the classdeclaration and that value cannot be modified:

3. virtual method
(If at least one of the methods of the base class is virtual then a"header" of 4 bytes is added to every instance of the classes. Thisallows the program to determine what a vector actually points to.)(4 bytes is probably implementation specific. On a 64 bit machine maybeit is 8 bytes...)