void* Pointers and Pointers in Logical Expressions
Explore how void pointers in D can reference any data type and the steps to safely convert them to specific types. Understand the use of pointers in logical expressions, including null pointer checks, to control program flow and interaction with C libraries.
We'll cover the following...
We'll cover the following...
void* can point at any type
Although it is almost never needed in D, C’s special pointer type void* is available in D as well. void* can point at any type:
The void* above is able to point at variables of two different types: int and double.
void* pointers are limited in functionality. As a consequence of their flexibility, they cannot provide access to the pointee. ...