printf works! I had two copies of ns and I made changes to one of them. The PATH variable was pointing to the original ns folder. Whereas, I wanted to test the result of the changes made in the ns-copy folder. When I gave, ns file1.tcl, the original ns pointed out by PATH was being used. Hence, I could not see the effect of the changes although I was able to compile them successfully. To see which ns folder is being used, issue the command "which ns".
To use the ns other than the default one pointed by PATH, traverse to the new ns folder and to the location in which the tcl file is located and give "../../ns file1.tcl" Thanks to my teachers who helped me by pointing out my mistake. --- On Thu, 17/3/11, Ns Learner <ns2.lear...@yahoo.com.au> wrote: From: Ns Learner <ns2.lear...@yahoo.com.au> Subject: Re: [ns] Debugging ns code (.cc files) with print statements To: "pedro chaparro" <pdr...@gmail.com>, ns-users@ISI.EDU Received: Thursday, 17 March, 2011, 2:27 PM Thanks, Pedro. I used printf in tcp.cc file inside the methods that are usually called. But, I don't get any statements printed on the console. What could be the mistake? Thanks. --- On Thu, 17/3/11, pedro chaparro <pdr...@gmail.com> wrote: From: pedro chaparro <pdr...@gmail.com> Subject: Re: [ns] Debugging ns code (.cc files) with print statements To: "Ns Learner" <ns2.lear...@yahoo.com.au> Received: Thursday, 17 March, 2011, 4:42 AM u can use printf, bu cout should works too!!! 2011/3/14 Ns Learner <ns2.lear...@yahoo.com.au> Hello, I am trying to debug ns code (.cc files) with print or cout statements. With cout, I get this error message: error: ISO C++ forbids declaration of ‘cout’ with no type error: expected ‘;’ before ‘<<’ token I tried inserting using namespace std and it still gives me an error message. Print or printf statements simply do not print message on to my console. Can somebody help? Thanks :D -- Pedro Alonso Chaparro Valero R&D Engineer Ciudad Politecnica de la Innovación iTEAM - Mobile Communications Group Polytechnic University of Valencia C\ Camino de Vera S/N, Edificio 8G 46022 Valencia, Spain