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 c++ to tcl using NS2?

  • The variable (total value) in c++ is passed to tcl as follows.
    C++ part :

    int total_val = 100;FILE *output;output = fopen("result.tcl", "a+");fprintf(output,"set total_value %ld \n",total_val);fclose(output);

  • TCL part :

    source ./result.tcl
    puts “Total value $total_value”

  • Result :

    Total value 100