The return type ns3::NetDevice::GetChannel()is a kind of customizable smart pointer; without seeing the definition of this, we can only guess how you can convert this to a raw pointer.
It may implement the conversion operator operator T*(), although this is usually considered a bad idea, as it makes unintentional conversions too easy to perform by accident. In this case, you can do:
void * check = ns3::NetDevice::GetChannel();
, , - . get():
void * check = ns3::NetDevice::GetChannel().get();
, , ( , , , ):
void * check = &*ns3::NetDevice::GetChannel();
void *, static_cast, unsigned char *, , . , , undefined.
UPDATE: ns3::Ptr , , :
void * check = PeekPointer(ns3::NetDevice::GetChannel());