void data type

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..
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.
It is actually a data type and you can create a variable with it:

void *pointer_to_void = ...;
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
Topic archived. No new replies allowed.