title: Cast object pointer to char array
body: <pre><code>unsigned char *check = NULL;
  check = (dynamic_cast&lt;unsigned char *&gt;( ns3::NetDevice::GetChannel() ));
  </code></pre>
  
  <p>This is what I am trying. But the error is:</p>
  
  <pre><code>error: cannot dynamic_cast ‘ns3::NetDevice::GetChannel() const()’ (of type ‘class       ns3::Ptr&lt;ns3::Channel&gt;’) to type ‘unsigned char*’ (target is not pointer or reference to class)
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>reinterpret_cast
  </code></pre>
  
  <p>But it doesn't work at all.</p>