C++笔记2019-06-16

    Information hiding is conducive to program expansion and error detection, which separates the public interface of the class from the private implementation code. Accessing data through class member functions defined as inline functions will not reduce the efficiency of program execution due to the absence of function calls.

    A common mistake in programming is to use objects that have not been properly initialized beforehand.Define constructors in classes to initialize objects automatically.

    C++ supports the function overloading mechanism, which allows multiple functions to use the same name, with the limitation that their parameter tables must be different: different parameter types or different number of parameters.

    Add a wavy line to the class name to mark the destructor, which releases the resources acquired during the use or construction of class objects.

    Constructors and destructors are functions provided by programmers, and they do not construct or destroy class objects (compilers automatically apply them to class objects).

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容