How can I pass a pointer (Object *ob
) to a function which prototype is void foo(Object &)
?
This question is related to
c++
pointers
casting
reference
type-conversion
foo(*ob);
You don't need to cast it because it's the same Object type, you just need to dereference it.
Source: Stackoverflow.com