View | Details | Raw Unified | Return to bug 930
Collapse All | Expand All

(-)a/examples/topology-read/topology-example-sim.cc (-3 / +7 lines)
 Lines 119-125    Link Here 
119
  int totlinks = inFile->LinksSize ();
119
  int totlinks = inFile->LinksSize ();
120
120
121
  NS_LOG_INFO ("creating node containers");
121
  NS_LOG_INFO ("creating node containers");
122
  NodeContainer nc[totlinks];
122
  NodeContainer* nc = new NodeContainer[totlinks];
123
  TopologyReader::ConstLinksIterator iter;
123
  TopologyReader::ConstLinksIterator iter;
124
  int i = 0;
124
  int i = 0;
125
  for ( iter = inFile->LinksBegin (); iter != inFile->LinksEnd (); iter++, i++ )
125
  for ( iter = inFile->LinksBegin (); iter != inFile->LinksEnd (); iter++, i++ )
 Lines 128-134    Link Here 
128
    }
128
    }
129
129
130
  NS_LOG_INFO ("creating net device containers");
130
  NS_LOG_INFO ("creating net device containers");
131
  NetDeviceContainer ndc[totlinks];
131
  NetDeviceContainer* ndc = new NetDeviceContainer[totlinks];
132
  PointToPointHelper p2p;
132
  PointToPointHelper p2p;
133
  for (int i = 0; i < totlinks; i++)
133
  for (int i = 0; i < totlinks; i++)
134
    {
134
    {
 Lines 140-146    Link Here 
140
140
141
  // it crates little subnets, one for each couple of nodes.
141
  // it crates little subnets, one for each couple of nodes.
142
  NS_LOG_INFO ("creating ipv4 interfaces");
142
  NS_LOG_INFO ("creating ipv4 interfaces");
143
  Ipv4InterfaceContainer ipic[totlinks];
143
  Ipv4InterfaceContainer* ipic = new Ipv4InterfaceContainer[totlinks];
144
  for (int i = 0; i < totlinks; i++)
144
  for (int i = 0; i < totlinks; i++)
145
    {
145
    {
146
      ipic[i] = address.Assign (ndc[i]);
146
      ipic[i] = address.Assign (ndc[i]);
 Lines 200-205    Link Here 
200
  Simulator::Run ();
200
  Simulator::Run ();
201
  Simulator::Destroy ();
201
  Simulator::Destroy ();
202
202
203
  delete[] ipic;
204
  delete[] ndc;
205
  delete[] nc;
206
203
  NS_LOG_INFO ("Done.");
207
  NS_LOG_INFO ("Done.");
204
208
205
  return 0;
209
  return 0;

Return to bug 930