May 26, 2009 at 10:26am UTC
I want to run my program using the command line arguments of main function like this:
1 2
./p2ptv PeerBandwidths={{0.271,0.2,INF},{0.661,0.35,INF},{0.0691,3.5,INF}}
when I input the above command line statement on the linux terminal
there will be errors.
after debuging, my discovery is
1 2 3 4 5 6 7 8 9
(gdb) print argv[1]
$2 = 0xbf87a62c "PeerBandwidths=0.271"
(gdb) print argv[2]
$3 = 0xbf87a641 "PeerBandwidths=0.2"
(gdb) print argv[3]
$4 = 0xbf87a654 "PeerBandwidths=INF"
(gdb) print argv[4]
$5 = 0xbf87a667 "PeerBandwidths=0.661"
this is strange, since what I expect is
argv[1]=PeerBandwidths={{0.271,0.2,INF},{0.661,0.35,INF},{0.0691,3.5,INF}}
however, when I ran the program on the IDE "eclipse"
and added the arguments in it, the program ran successfully.
but if I debug the program using "eclipse", the same error is raised too.
what is the reason for this?
thanks!
Last edited on May 26, 2009 at 10:28am UTC
May 26, 2009 at 10:35am UTC
Please try to run your program by following way
./p2ptv "PeerBandwidths={{0.271,0.2,INF},{0.661,0.35,INF},{0.0691,3.5,INF}}"
May 26, 2009 at 10:49am UTC
You used incorrect quotes.
My example should work properly, I've tried it on my linux machine
May 26, 2009 at 10:51am UTC
yes,you reminded me that the quotes I used are in another format.
I'm sorry