Data-type void has some special features:
- it doesn't have values
- it doesn't have size
- you cannot declare variables with it
- void *pointers cannot be dereferenced
Wiki User
∙ 2011-06-15 17:55:13void is not a data type, void means empty. We use void when declaring a function: void getd(); now getd() function will not return any value.
Void is not relay a data type as there is no size of storage associated with it where as char, int, long, float etc have a specific size (how many bytes are required to store the variable in). When it comes to pointers void is the universal pointer. When void is used as a function argument in a function prototype. void foo(void) The first void means that the function does not return a value. The second void means that there are no function arguments for the function. This should not be confused with. void* bar(void *) Bar returns a pointer of type void and receives an argument of a void pointer.
functions declared as void data type return nothing, whereas non void datatype returns some value
"void" is not a data type but a keyword that indicates the absence of data type. // cannot create a variable of type "void" because "void" is not a type // the following statement is incorrect: void x; // can use keyword "void" to say that a function takes no parameters int function_without_parameters(void); // can use keyword "void" to say that a function does not return a result void function_without_result(int); // can use keyword "void" to say that we do not know what kind of data type a pointer points to void* pointer_to_unknown_datatype;
It does't have size, because it is not an actual type. Void-pointer on the other hand is a generic pointer, sizeof (void *) gives it size.
void isn't an actual data-type, preemptive(?) or otherwise.
void is not a data type, void means empty. We use void when declaring a function: void getd(); now getd() function will not return any value.
Void is not relay a data type as there is no size of storage associated with it where as char, int, long, float etc have a specific size (how many bytes are required to store the variable in). When it comes to pointers void is the universal pointer. When void is used as a function argument in a function prototype. void foo(void) The first void means that the function does not return a value. The second void means that there are no function arguments for the function. This should not be confused with. void* bar(void *) Bar returns a pointer of type void and receives an argument of a void pointer.
functions declared as void data type return nothing, whereas non void datatype returns some value
"void" is not a data type but a keyword that indicates the absence of data type. // cannot create a variable of type "void" because "void" is not a type // the following statement is incorrect: void x; // can use keyword "void" to say that a function takes no parameters int function_without_parameters(void); // can use keyword "void" to say that a function does not return a result void function_without_result(int); // can use keyword "void" to say that we do not know what kind of data type a pointer points to void* pointer_to_unknown_datatype;
It does't have size, because it is not an actual type. Void-pointer on the other hand is a generic pointer, sizeof (void *) gives it size.
void is type of pointer that usually means that you can make it point to any data type. When you make a pointer point to somewhere its data type should match with the place where you want it to point. When you dont know the data type where it will point to then you can declare a void pointer and make it point to the data type it want.
what is void data type Void is an empty data type normally used as a return type in C/C++, C#, Java functions/methods to declare that no value will be return by the function. The another use of void is to declare the pointer in C/C++ whe It is not sure that what data type will be addressed by the pointer. eg: void *p; Here p can hold the address of int or float or char or long int or double.
No. void is not a data type. It is mandatory for all java methods to return something and if it is not going to return anything, we have to mark the method with a "void" return type to let the JVM know that it must not expect anything from the method.
Void Pointer is a General purpose pointer ,that does not have any data type associated with it and can store address of any type of variable. Declaration: void * pointer_name;
void, in C, is a type that has no size. Thus, if you were to declare a variable of type "void", the compiler would not know how much memory to allocate for it.
The voiddata type is used when a function doesn't return any value, and/or when it has no parameters at all. Pointer type 'void *' is a generic pointer.A void pointer is used when it needs to be assigned to different data types later on in a program. Since it avoids type checking, void pointers should be used with care.