I have been reading up on casting allocations in C (c11) and wonder what changes when it becomes a pointer-pointer
Say I have a function
void** foo( someInput )
which allocates and instantiates one of many types of pre-typedef'd structs. Why does;
MyStructA **mystructa = foo(...);
result in the compiler warning Incompatible pointer types passing ... to type void**
This causes me to cast the allocation, which seems to be generally frowned upon with single-pointers.
MyStructA **mystructa = (MyStructA**) foo(...someInput..);
MyStructB **mystructb = (MyStructB**) foo(...someOtherInput...);
Just looking for a little insight from the community, and didn't see any previous discussion on this.