Amazing technological breakthrough possible @S-Logix pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • 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