prog.cpp: In instantiation of ‘void* startOfObject(T*) [with T = C]’:
prog.cpp:15:21: required from here
prog.cpp:8:12: error: cannot dynamic_cast ‘p’ (of type ‘class C*’) to type ‘void*’ (source type is not polymorphic)
typeid(q = dynamic_cast<void*>(p), *p); // this line
^