Легенда:
новое сообщение
закрытая нитка
новое сообщение
в закрытой нитке
старое сообщение
|
- Напоминаю, что масса вопросов по функционированию форума снимается после прочтения его описания.
- Новичкам также крайне полезно ознакомиться с данным документом.
[C++] Похоже я ошибся [update] 04.03.05 11:57 Число просмотров: 2651
Автор: amirul <Serge> Статус: The Elderman Отредактировано 04.03.05 13:13 Количество правок: 2
|
http://www.nfra.nl/~gvd/cpp-wp/conv.html#conv.ptr
4.10 Pointer conversions [conv.ptr]
1 An integral constant expression expr.const rvalue that evaluates
to zero (called a null pointer constant) can be converted to a pointer
type. The result is a value (called the null pointer value of that
type) distinguishable from every pointer to an object or function.
Two null pointer values of a given type compare equal.
---
Вот собственно и все. Целый ноль может быть преобразован к указателю любого типа.
----------
Более того:
4.12 Boolean conversions
1 An rvalue of arithmetic, enumeration, pointer, or pointer to member type can be converted to an rvalue of
type bool. A zero value, null pointer value, or null member pointer value is converted to false; any
other value is converted to true.
---
|
|
|