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?

  1. `float f=*(float)ptr;`
  2. `float f=(float *)ptr;`
  3. `float f=(float)*ptr;`
  4. `float f=*(float *)ptr;`

Answer: The correct answer of the above question is Option D:`float f=*(float *)ptr;`