Research breakthrough possible @S-Logix pro@slogix.in

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to pass the variable tcl to c++ using NS2?

  • The variable (total number of nodes) in tcl is passed to c++ as follows.
    TCL part :

    Example : AODV protocol
    Agent / AODV set total_nodes_ 50

  • C++ part :

    int total_nodes_ ; // in header file
    bind(“total_nodes_,&total_nodes);
    Printf(“Total number of nodes %d \n”,total_nodes_);

  • Result :

    Total number of nodes 50