diff -r d36455b47a34 examples/topology-read/topology-example-sim.cc --- a/examples/topology-read/topology-example-sim.cc Sun May 30 20:54:25 2010 -0700 +++ b/examples/topology-read/topology-example-sim.cc Mon May 31 15:57:59 2010 +1000 @@ -119,7 +119,7 @@ int totlinks = inFile->LinksSize (); NS_LOG_INFO ("creating node containers"); - NodeContainer nc[totlinks]; + NodeContainer* nc = new NodeContainer[totlinks]; TopologyReader::ConstLinksIterator iter; int i = 0; for ( iter = inFile->LinksBegin (); iter != inFile->LinksEnd (); iter++, i++ ) @@ -128,7 +128,7 @@ } NS_LOG_INFO ("creating net device containers"); - NetDeviceContainer ndc[totlinks]; + NetDeviceContainer* ndc = new NetDeviceContainer[totlinks]; PointToPointHelper p2p; for (int i = 0; i < totlinks; i++) { @@ -140,7 +140,7 @@ // it crates little subnets, one for each couple of nodes. NS_LOG_INFO ("creating ipv4 interfaces"); - Ipv4InterfaceContainer ipic[totlinks]; + Ipv4InterfaceContainer* ipic = new Ipv4InterfaceContainer[totlinks]; for (int i = 0; i < totlinks; i++) { ipic[i] = address.Assign (ndc[i]); @@ -200,6 +200,10 @@ Simulator::Run (); Simulator::Destroy (); + delete[] ipic; + delete[] ndc; + delete[] nc; + NS_LOG_INFO ("Done."); return 0;