什么是无效的数据类型和空指针的实际用途? [英] what is the practical use of void datatype and void pointer?

查看:249
本文介绍了什么是无效的数据类型和空指针的实际用途?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

空隙变量无关,也void指针只能铸造指出。
所以,空指针使用时,我们其实不知道在哪里,其中和数据类型,我们想做点。但是,什么是无效的变量?

Void variable has nothing to do and also void pointer can only be pointed with casting. So void pointer is used when we actually don't know where and of which data type we want to point. But what is of void variable?

任何实际的例子?

推荐答案

在C 无效不能被认为是一种数据类型,它是作为一个占位符关键字代替一个数据类型的显示,实际上没有数据

In C void can't be considered a data type, it is a keyword used as a placeholder in place of a data type to show that actually there is no data.

例如考虑功能无效F(无效); 。这里关键字void用来指缺乏通过任何参数和返回值的

For example consider the function void f(void);. Here the keyword void is used to mean the absence of any parameters passed and returned values.

无效* PTR; 是意义不同。

这声明了一个指针,没有这些数据类型,它指向指定。

This declares a pointer without specifying which data type it is pointing to.

这篇关于什么是无效的数据类型和空指针的实际用途?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆