码迷,mamicode.com
首页 > 编程语言 > 详细

【C/C++】void

时间:2015-06-09 19:03:32      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:

void

The (nonexistent) value of a void expression (an expression that has type void) shall not be used in any way, 
and implicit or explicit conversions (except to void) shall not be applied to such an expression. If an expression 
of any other type is evaluated as a void expression, its value or designator is discarded. (A void expression is 
evaluated for its side effects.)

void;
/***************************************
nullptr 

both (int*)0 and nullptr are valid template-arguments for a non-type template-parameter of type “pointer to int.”

【null pointer constant】

An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer 
constant.66) If a null pointer constant is converted to a pointer type, the resulting pointer, called a null pointer, 
is guaranteed to compare unequal to a pointer to any object or function

nullptr对应的一定是指针型变量,而null对应的有可能是指针型变量或者常量0

Types *val = nullptr;

 

【C/C++】void

标签:

原文地址:http://www.cnblogs.com/Susake/p/4563906.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!