answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the three uses of void data types?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the three most common data types used in c?

Pick any three: int, char, long, void, char *, void *


What TYPES of return values are allowed?

Apart from basic Data types (int , char , float and double ) you can even return Class Objects.Nearly any type of Data can be returned by a function including pointers to void data type.


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.


Empty data types in C?

Void - is empty data type in C


Why void is preemptive data type?

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


What are the basic data type and subtype used by C compiler .explain properly?

Basically data types are divided into three types namely, 1. primary data type -> this is sub divide into int, float, char, void. 2. derived data type -> this is sub divide into array, pointer. 3. user defined data type -> this is sub divide into struct, union, enum, typedef. by, k.p.sruthi


What are the 'data types' provided in c?

1. void 2. int 3. float 4. double 5. char


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 use of void data types?

When a function declares it returns void, it means it does not return anything. Sometimes the function doesn't need to return anything, so using void is convenient. In C: using voidinstead of parameters means 'there's no parameters'


First argument of fwrite function is typecast to?

void * wlen= fwrite ((void *)&data, 1, sizeof (data), file); if (wlen != sizeof (data)) ... error ...


How do you Write a function prototype for a function named printStars that accepts no arguments and returns no data?

void printStarts (void);


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.