What is a void pointer? Ans. A void pointer is a C convention for 'a raw address.' The compiler has no idea what type of object a void pointer 'really points to.' If you write int *ip; ip points to an int. If you write void *p; p doesn't point to a void! In C and C , any time you need a void pointer, you can use another pointer type. For example, if you have a char*, you can pass it to a function that expects a void*. You don't even need to cast it. In C (but not in C ), you can use a void* any time you need any kind of pointer, without casting. (In C , you need to cast it.) - Study24x7
Social learning Network

Warning: include(./views/auth.php): failed to open stream: Permission denied in /var/www/html/live/loginRightSlider.php on line 18

Warning: include(): Failed opening './views/auth.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/live/loginRightSlider.php on line 18

Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/live/makepost.php on line 52
05 Apr 2023 11:31 AM study24x7 study24x7

What is a void pointer? Ans. A void pointer is a C convention for "a raw address." The compiler has no idea what type of object a void pointer "really points to." If you write int *ip; ip points to an int. If you write void *p; p doesn't point to a void! In C and C++, any t...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles