Pay attention to pointers: always initialize your pointers

来源:互联网 发布:苹果mac搜狗输入法 编辑:程序博客网 时间:2024/05/16 10:12

1. Define a pointer after the object to which it points has been defined.

2. If not, initialize the pointer to nullptr or zero.

 

Reference:

S.B. Lippman, "C++ Primer (5th version)", PUBLISHING HOUSE OF ELECTRONICS INDUSTRY, Beijing, 2013