1 / 14
文档名称:

c、c 概念性面试(C and c conceptual interview).doc

格式:doc   大小:40KB   页数:14页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

c、c 概念性面试(C and c conceptual interview).doc

上传人:dzzj200808 2018/8/31 文件大小:40 KB

下载得到文件列表

c、c 概念性面试(C and c conceptual interview).doc

相关文档

文档介绍

文档介绍:c、c++概念性面试(C and c++ conceptual interview)
1. what is the difference between a pointer and a reference? If a reference is safer than a pointer, why? Wouldn't it be okay if I used const pointers?
(1) references must be initialized when they are created; and pointers do not have to be initialized at the time they are defined
(2) there is no null reference; the reference must be associated with the legal storage unit; the pointer can be NULL.
(3) once a reference is initialized, the point cannot be changed; the pointer can change the point at any time. Assigning the reference does not change its binding relation to the original object
(4) the creation and destruction of the reference does not call the copy constructor of the class
(5) at the language level, the reference is the same as the object; on the binary level, references are generally implemented by pointers, but piler helps plete the conversion
There is no null reference, and the reference is safe once it is initialized to point to an object, and it cannot be changed to a reference to another object.
The const pointer still has an empty pointer and is likely to generate wild pointers
Generally speaking, reference has both the efficiency of pointer and the convenience and intuition of variable usage
There are several ways to pass the 2. parameter; what is the way to implement polymorphic parameter passing?
Pass a value, pointer, or reference
Pass a pointer or reference
What are the differences between the 3. C++ and the C definition structures?.
C's structure is only bination of data, C++'s struct and class actually have almost the same function, but the default access attributes are different. C structure can not be placed function, C++ structure can be.
Defining the structure variable in C requires the struct keyword, and C++ does not.
(in fact, the structure in C can be implemented based on objects and can be implemented by defining function pointers in the structure)
The 4. constructor will