void data type

Jan 19, 2016 at 9:24am
I have a confusion

void is one of the fundamental data type.
But it does not take any variable,then Why it is
called as a datatype?

Please clarify my confusion..
Jan 19, 2016 at 9:41am
You're getting caught up in labelling things. Forget about the label.

void is what you say when you want to indicate that there is no parameter. That there is no value.

If you don't want to call it a data type, then don't. It's just a label. Do you understand what it means and when to use it? That's all that matters. If you don't want to call it a data type, then don;t. If you do, then do. The label doesn't matter. Spend your brain thinking about things that matter.
Jan 19, 2016 at 10:14am
It is actually a data type and you can create a variable with it:

void *pointer_to_void = ...;
Jan 19, 2016 at 10:21am
I would argue that hasn't created a void object, but has created a pointer, and that pointer will never point to an object of type "void" because no such object can exist.

That's just individual meaning, though. Everyone here knows what it does; now we're just arguing over applying English phrases to something it was never meant to describe.
Last edited on Jan 19, 2016 at 10:22am
Topic archived. No new replies allowed.