answersLogoWhite

0


Best Answer

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

User Avatar

Wiki User

2011-06-15 17:55:13
This answer is:
User Avatar
Study guides

Mixture

1 card

Class

➡️
See all cards
4.24
25 Reviews

Add your answer:

Earn +20 pts
Q: What is the size of void data type?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Is void a data type in c?

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.


What is void data type work in c?

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.


What is difference between void and non void data type?

functions declared as void data type return nothing, whereas non void datatype returns some value


What are the applications of void data types in c plus plus?

"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;


What is the size of void?

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.

Related questions

Why void is preemptive data type?

void isn't an actual data-type, preemptive(?) or otherwise.


Is void a data type in c?

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.


What is void data type work in c?

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.


What is difference between void and non void data type?

functions declared as void data type return nothing, whereas non void datatype returns some value


What are the applications of void data types in c plus plus?

"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;


What is the size of void?

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.


Why do you use a void pointer in a programme?

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 in c?

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.


Is void data type in java?

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.


What is the use of void pointer?

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;


Why can you not declare void variables in c?

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.


Application of void data type in c plus plus programming language?

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.

People also asked