void uses and application

My first understanding of voId is not of real use but in most classes it is in use and in main function it is used. My perception of the use is as destuctor for constuctors, is the void use for members, methods, declations or inatailzation are they also void classes are they deststuctors for classes, percieve gathering of void use is it correct to say that void is the largest destuctor possible, meaning I'm not mis understood I haven't grasp the container and the partional workings yet, but I know a class is a type and void as class on its self so don't miss understand my cloudedness. Ps forgive my spelling
It was kind of difficult to understand what you were saying but...

void main is not standard, use int main.

Constructors/Destructors do not return anything (not even void).

void is not a class nor an object.
Void in the parameters of int main or between{} some how as expression, method, member function are statement meaning declared or inatialzed, I see it in use in higher chapters of c++ books so my thoughts are in allocation of memory which the use of void becomes like using destuctors for constructors for the releasing of memory.
Void is a data type (just like int, bool, double, etc) that symbolizes the absence of data. Returning void can be done as: return; Void is also used as a parameter to represent the absence of parameters: int main(void) is an example of this.

Void pointers is a special type of pointers, they do not point to "nothing" (NULL pointers do this already). Void pointers can point to anything. The only downside for this is that you can't dereference them directly (you need to cast them first, using reinterpret_cast<....*>(x).
Void is templated like each and every c++ type, given guide lines by the c++ developers , so groups objects are like arrays classes are like types. My understand leads me to belive that templated is like constant and remains how it is in the libray, and void is a class in the type template of c++. I am not straying from my ? So please don't debate the class issue. Ps forgive my spelling
Kyon wrote:
The only downside for this is that you can't dereference them directly

If I'm not mistaken you can't have containers or arrays of void pointers because you can't do pointer arithmetic on them (because the compiler doesn't know the size of the object pointed to).
Kyon wrote:
Void is also used as a parameter to represent the absence of parameters: int main(void) is an example of this.


Also note that this is a holdover from C and is utterly unnecessary in C++. You can just say int main().
Topic archived. No new replies allowed.