Here is my Code:
NodeContainer nodes;
nodes.Create (2); //creat 2 nodes they are p2p
PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("2Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("20ms"));
NetDeviceContainer devices;// put nodes in ndc
devices = pointToPoint.Install (nodes);
////give them an address
InternetStackHelper stack;
stack.Install (nodes);
Ipv4AddressHelper address;
address.SetBase ("109.11.12.0", "255.255.255.0");//address setting
Ipv4InterfaceContainer interfaces = address.Assign (devices);
////Node Container 1 End Here...
/////Node Contatiner 2
NodeContainer nodes1;
nodes1.Add(nodes.Get(1));
nodes1.Create (2); //creat 2 nodes they are p2p
PointToPointHelper pointToPoint1;
pointToPoint1.SetDeviceAttribute ("DataRate", StringValue ("2Mbps"));
pointToPoint1.SetChannelAttribute ("Delay", StringValue ("20ms"));
NetDeviceContainer devices1;// put nodes in ndc
devices1 = pointToPoint1.Install (nodes1);
////give them an address
InternetStackHelper stack1;
stack1.Install (nodes1);
Ipv4AddressHelper address1;
address1.SetBase ("107.11.12.0", "255.255.255.0");//address setting
Ipv4InterfaceContainer interfaces1 = address.Assign (devices1);
////Node Container 2 End Here..
/////Node Contatiner 3
NodeContainer nodes2;
nodes2.Add(const NodeContainer &nodes,const NodeContainer &nodes1);
Showing Me This Error... Searched alot but No Solution Found....
../scratch/Test.cc: In function ‘int main(int, char**)’:
../scratch/Test.cc:214:13: error: expected primary-expression before ‘const’
nodes2.Add(const NodeContainer &nodes,const NodeContainer &nodes1); //creat 2 nodes they are p2p
^
../scratch/Test.cc:214:40: error: expected primary-expression before ‘const’
nodes2.Add(const NodeContainer &nodes,const NodeContainer &nodes1); //creat 2 nodes they are p2p
Help me where are am doing wrong.... Thanks in advance