+ 1

What is the meaning of void* ? What it works?

void pointer means and what it will give us ?

10th Dec 2016, 2:01 PM
shivam bhardwaj
shivam bhardwaj - avatar
1 Réponse
+ 3
It is also know as generic pointer that can be pointed at objects of any data type. It maybe int, float, double. It has no return type that is initially pointer is created with pointer type (having hex value) and we can assign this pointer to any type of data. Example #include <iostream> using namespace std; int main() { void* ptr; float f = 2.3; ptr = &f; // float* to void cout << &f << endl; cout << ptr; return 0; }
10th Dec 2016, 2:46 PM
Vipul Walia
Vipul Walia - avatar