06-01-2017, 06:07 AM
misra cpp Wrote:NULL is defined in C++ (see 4.10 of the Language Reference Manual).
Note that 4-10-2 does not ban the use of the token "NULL", but it does prohibit the use of literal "0" as a null pointer.
according to ISO-IEC-14882(2003)
Quote:C.2.2.3 Macro NULL [diff.null]According to 4.10 of the C++ standard, a null pointer constant is defined as an integer type of rvalue that is zero.
1 The macro NULL, defined in any of , , , , ,
, or , is an implementation-defined C + + null pointer constant in this International
Standard (18.1).
In order to use NULL, special headers must be included in the code, and 0 is defined as a null pointer constant in the C ++ standard, so I think it is more correct to use 0 rather than NULL.
<t></t>