answersLogoWhite

0

What is the size of void data type?

Updated: 8/10/2023
User Avatar

Wiki User

12y ago

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

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

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.

This answer is:
User Avatar

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?

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.


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.


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 are the three uses of void data types?

The void type has only one purpose: to specify the return type of a function that has no return value. In this case void simply means no type. The only other usage is when used as a pointer to void (void*), which simply means a pointer type that can refer to any type of object. If the pointer is non-null, it must be cast to a specific type before it can be dereferenced.


What is returntype?

A return type describes the type of data which is returned by a call to a method. They keyword void is used to describe a method which does not return any data.

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?

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.


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.


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


What are the three uses of void data types?

The void type has only one purpose: to specify the return type of a function that has no return value. In this case void simply means no type. The only other usage is when used as a pointer to void (void*), which simply means a pointer type that can refer to any type of object. If the pointer is non-null, it must be cast to a specific type before it can be dereferenced.


What is returntype?

A return type describes the type of data which is returned by a call to a method. They keyword void is used to describe a method which does not return any data.


Is 'void' a data type in java?

No. The void keyword is used to signify that a method will not return any objects. For example, if you type in "double", you'll need a return statement that has a double. So "void" means that there will be nothing returned.


What use of void data type in c plus plus?

doesn't return the value.


What is an unlimited data type?

Hard to tell, I don't think there is such thing. Perhaps void?


What are the applications of void data types inc plus plus?

void data type is used in function declaration. It can be explained by examle void add(int,int); this will tell the compiler that no value is going to be returned by the function. int add(int,int); this indicates that an integer type value will be returned by the function


What is the data type of the parameter of the second version of the method?

Given that you haven't specified the method in question it is impossible to say what the parameter's data type would be. However, in statically typed languages such as Java, the method's signature will tell you specifically which data type is to be expected: void f (int x) { // expects an argument of type int // ... } void f (float x) { // expects an argument of type float // ... }