Skip to content

Commit 06d798b

Browse files
committed
reference/cstddef/null.md: Created sample program
1 parent 75705c0 commit 06d798b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

reference/cstddef/null.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
- `<ctime>`
2121
- `<cwchar>`
2222
23+
## 例
24+
```cpp example
25+
#include <cstddef>
26+
int main() {
27+
int* p = NULL;
28+
delete p;
29+
}
30+
```
2331

2432
## 備考
2533
C++03において、「ヌルポインタ定数」は「値が0になる整数定数式」と定義されていた。したがって、マクロ`NULL`の値として`0`や`0L`は規格に適合するが、`(void*)0`は整数定数式ではないため適合しない。

0 commit comments

Comments
 (0)