| Question | Key words | Anwser |
A | assignment operator |
|
|
| abstract class |
| It is a class that has one or more pure virtual functions. |
| assignment & | constructed -> change value | Assignment changes the value of the object that has already been constructed. Initialization constructs a new object and gives it a value at the same time. |
| array & |
| An array is a sequential collection of same kind of data elements. |
| argument passing | call-by-value | call-by-value. This method copies the |
B |
|
|
|
C | constructor | object , initialize | Constructor creates an object and initializes it. It also creates vtable for virtual functions. It is different from other methods in a class. |
| copy constructor | initialze by another object | Constructor which initializes the it's object member variables ( by shallow copying) with another object of the same class. If you don't implement one in your class then compiler implements one for you. |
| conversion constructor | single argument | constructor with a single argument makes that constructor as conversion ctor and it can be used for type conversion. |
| const reference arguments |
| a) Using const protects you against programming errors that inadvertently alter data. |
| container class |
| A container class is a class that is used to hold objects in memory or external storage. A container class acts as a generic holder. A container class has a predefined behavior and a well-known interface. A container class is a supporting class whose purpose is to hide the topology used for maintaining the list of objects in memory. When a container class contains a group of mixed objects, the container is called a heterogeneous container; when the container is holding a group of objects that are all the same, the container is called a homogeneous container. |
| const |
| 表示常量不可以修改 |
|
|
|
|
D | destructor | delete | Destructor usually deletes any extra resources allocated by the object. |
| data structure |
| A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other. Advance knowledge about the relationship between data items allows designing of efficient algorithms for the manipulation of data. |
|
|
|
|
E | encapsulation | code and data | Encapsulation is welding of code and data together into objects. |
F |
|
|
|
G | globle variable & |
| In memory storage |
H | Heap & |
| Heap是堆,空间是由手动操作分配和释放的,它的存储区很大的自由存储区。 |
I | inheritance | derived properties/behavior | Inheritance is a mechanism through which a derived class inherits the properties and behavior of its base class |
| Iterator class | traverse | A class that is used to traverse through the objects maintained by a container class. There are five categories of iterators: |
| inline function | expanded | An inline function is a function whose code is expanded in line at the point at which |
J |
|
|
|
K |
|
|
|
L |
|
|
|
M | malloc()/free(), new/delete | memory , constructor/object | 1)malloc()/free() is function using c/c++, new/delete is operator , using in C++ |
| memory allocation |
| 1)static 内存在程序编译的时候就已经分配好,这块内存在程序的整个运行期间都存在。例如全局变 |
N |
|
|
|
O | Overloading (重载) & | Same function name , diff augs | Overloading is a method that allows defining multiple member functions with the same name but different signatures. |
P | polymorphism | virual funcition , inheritance | one interface, mutipul methods |
| private,protected,public | members and friend class | Private members are accessible only by members and friends of the class. Protected members are accessible by members and friends of the class and by members and friends of derived classes. Public members are accessible by everyone. |
| pure virtual function | virtual void show_area()=0; | A pure virtual function is a function declared in a base class that has no definition relative to the base." |
| potinter & | initialization/change/void | 1) Reference must be initialized , while pointer no need. |
Q |
|
|
|
R | reference | & | C++’s default parameter-passing convention is call-by-value,manually create a call-by-reference by passing the address of an argument (i.e., apointer to the argument) to a function. |
S | struct & class | default access level | The default access level assigned to members of struct is public while the default access level assigned to a class is private. |
| static member of a class | exist once | Static data members exist once for the entire class, as opposed to non-static data members, which exist individually in each instance of a class. |
| static |
| 1) static Local Variables |
| signature |
| Function's signature is its name plus the number and types of the parameters it accepts. |
| Silently write and call |
| Constructors, destructors, copy constructors, |
| storage classes | auto/register/static/extern | auto: the default. Variables are automatically created and initialized when they are defined and are destroyed at the end of the block containing their definition. They are not visible outside that block |
T | template & macro |
| Using template to create generic(template) functions and classes. In a template function or class, the type of data upon which the function or class operates is specified as a parameter. Thus, you can use one function or class with several different types of data,without having to explicitly recode specific versions for each data type. |
| this pointer | object's function call | The this pointer is a pointer accessible only within the member functions of a class, struct, or union type. It points to the object for which the member function is called. Static member functions do not have a this pointer. |
U | using' declaration? |
| A using declaration makes it possible to use a name from a namespace without the scope operator. |
V | virtual & | run-time | The behavior of a non-virtual function is known at compile time while the behavior of a virtual function is not known until the run time. |
| virtual function | derived class | 虚函数是指在基类中使用了vitual申明,并且在一个或多个派生类中被重新定义的函数 |
| Virtual Destructor? |
| sing virtual destructors, you can destroy objects without knowing their type |
| volatile |
| volatile
确保本条指令不会因
编译器的优化而省略,且要求每次直接读值.
简单地说就是防止
编译器对代码进行优化.
|