abu shahriar wrote: > I am getting segmentation fault when I call send(p,0) to broadcast a > packet > from my c++ code in ns. Can anyone please help me to find out why this > happe?
Install gdb or ddd, make sure you compiled ns with debugging symbols, start your debugger and let the program crash. Check the backtrace to see at which point it stopped working, set a breakpoint and start investigating while you're stepping through the code from that point on. If you've never worked with gdb/ddd before, it might look a little bit difficult at first but it's an absolute necessity for any serious programmer to master it. There are some excellent tutorials out there. As a starter, I'd recommend these http://heather.cs.ucdavis.edu/~matloff/UnixAndC/CLanguage/Debug.html http://www.unknownroad.com/rtfm/gdbtut/gdbtoc.html for gdb and this one http://heather.cs.ucdavis.edu/~matloff/Debug/Debug.pdf [PDF slideshow] for ddd. Good luck! --Timo