access variable inside constructor

how to access variable inside constructor

1
2
3
4
5
6
7
8
9
10
11
12
13
  class RoutingTableEntry
{
public:
  /// c-to
  RoutingTableEntry (Ptr<NetDevice> dev = 0,Ipv4Address dst = Ipv4Address (), bool vSeqNo = false, uint32_t m_seqNo = 0,
                     Ipv4InterfaceAddress iface = Ipv4InterfaceAddress (), uint16_t  hops = 0,
                     Ipv4Address nextHop = Ipv4Address (), Time lifetime = Simulator::Now ());

  ~RoutingTableEntry ();
}
 RoutingTableEntry falseToDst(dev,dst,true,rreqHeader.GetDstSeqno()+100,m_ipv4->GetAddress (m_ipv4->GetInterfaceForAddress(receiver),0),1,dst,ActiveRouteTimeout);

 if( falseToDst.hops == 1 ){std::cout<<"hihiih";}//is not working,why? 
if( falseToDst.hops == 1 ){std::cout<<"hihiih";}//is not working,why?

To access a variable inside a constructor, you have to actually be in a constructor..
Last edited on
Topic archived. No new replies allowed.