Question: Consider a pointer to void, named `ptr`, which has been set to point to a floating point variable `g`. Which choice is a valid way to dereference `ptr` to assign its pointed value to a float variable `f` later in the program?
- `float f=*(float)ptr;`
- `float f=(float *)ptr;`
- `float f=(float)*ptr;`
- `float f=*(float *)ptr;`
Answer: The correct answer of the above question is Option D:`float f=*(float *)ptr;`