unsigned char *check = NULL;
check = (dynamic_cast<unsigned char *>( ns3::NetDevice::GetChannel() ));
这就是我正在尝试的。但错误是:
error: cannot dynamic_cast ‘ns3::NetDevice::GetChannel() const()’ (of type ‘class ns3::Ptr<ns3::Channel>’) to type ‘unsigned char*’ (target is not pointer or reference to class)
我也试过:
reinterpret_cast
但它根本不起作用。