Mailinglist Archive: opensuse (1690 mails)

< Previous Next >
Re: [opensuse] c - Segmentation fault on 11.4 - need help figuring out (strtod?)
The real issue here is that C uses zero-base-index arrays

Yes there were 5 arguments in the example

argv[0] is the name of the program
and argv[1..4] were the parameters.

That is why you count from 1 .. argc-1 as opposed to 0 .. argc.


The zero-base-index arrays of C have caught many people out.

--
Man's mind once stretched by a new idea, never regains its original
dimension.
-- Oliver Wendell Holmes.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >