title: Problem with converting IP addresses in C++
body: <p>I need to find the IP address of my node in my code. Currently, I have this line:this line:</p>
  
  <pre><code>IPv4Address addr = nb_ipv4-&gt;GetAddress (maininterface , 0);
  </code></pre>
  
  <p>In this line, I expect to get the IP address for my main interface, but instead I see this error: </p>
  
  <pre><code>error:conversion from 'ns3::Ipv4InterfaceAddress' to non-scalar type 'ns3::Ipv4Address' 
  </code></pre>
  
  <p>Can anyone help me to solve this error?</p>