This page is optimized for mobile devices, if you would prefer the desktop version just click here

6.3 Void data type

An explanation of the void data type.

General discussion

The void data type has no values and no operations. It's a data type that represents the lack of a data type.

C++ Reserved Word void
Represent Nothing
Size N/A or None
Normal Signage N/A
Domain (Values Allowed) None

This data type was added in the transition from "C" to "C++". In "C" by default a function returned an integer data type. Some functions don't return a value of any kind. Thus, the need to have a data type that indicates nothing is being returned. The void data type is mainly used in the definition and prototyping of functions to indicate that either nothing is being passed in and/or nothing is being passed out.

Definitions

void data type
A data type that has no values or operators and is used to represent nothing.
<< Chapter < Page Page > Chapter >>

Read also:

OpenStax, Programming fundamentals - a modular structured approach using c++. OpenStax CNX. Jan 10, 2013 Download for free at http://cnx.org/content/col10621/1.22
Google Play and the Google Play logo are trademarks of Google Inc.
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use and Privacy Policy.