M
Matt
Hello. I've got a very strange problem. Basically I have a programme
where I wish to view all the strings in the argv array so I can see
what arguments are being passed to the programme.
However, when I insert the following line at the start of a FOR loop
early on the in the programme to do this:
printf("\nCommand line arguement %d: %s. \n", i , argv );
I get back the first 3, then I get a segmentation fault followed by
all kinds of errors. When I comment this line out he programme runs
with no problems.
It seems that reading and outputting the values of argv is changing
something in the programme. How can just outputting the values of argv
to the screen cause this?
Kind Regards,
Matt
where I wish to view all the strings in the argv array so I can see
what arguments are being passed to the programme.
However, when I insert the following line at the start of a FOR loop
early on the in the programme to do this:
printf("\nCommand line arguement %d: %s. \n", i , argv );
I get back the first 3, then I get a segmentation fault followed by
all kinds of errors. When I comment this line out he programme runs
with no problems.
It seems that reading and outputting the values of argv is changing
something in the programme. How can just outputting the values of argv
to the screen cause this?
Kind Regards,
Matt