Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: argc loop [tlug]
- Date: Mon, 25 Jun 2007 15:14:31 -0400
- From: Jim <jep200404@example.com>
- Subject: Re: argc loop [tlug]
- References: <14178ED3A898524FB036966D696494FB139B42@messenger.cv63.navy.mil> <87myyu68b6.fsf@uwakimon.sk.tsukuba.ac.jp> <20070625103300.0fea5bc0.jep200404@columbus.rr.com> <87ir9cgisl.fsf@uwakimon.sk.tsukuba.ac.jp>
"Stephen" wrote: > Jim writes: > > Also tolerable, but less readable, would be: > > > > while (*argv++!=(char *)0) > If you insist on accessing the argv array, the correct idiom is > > do { ... } while (*argv++ != NULL); When argc is zero, the former code "does nothing gracefully", while the latter code requires another test inside the loop to avoid dereferencing a null pointer.
- Follow-Ups:
- Re: argc loop [tlug]
- From: Stephen J. Turnbull
- References:
- [tlug] Re: font encoding question
- From: burlingk
- [tlug] Re: font encoding question
- From: Stephen J. Turnbull
- argc loop . . . . . (was: Re: [tlug] Re: font encoding question)
- From: Jim
- argc loop . . . . . (was: Re: [tlug] Re: font encoding question)
- From: Stephen J. Turnbull
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] RE: Line Lengths (when to wrap and when not to)
- Next by Date: Re: Quoting for Thread Breaking Digest Replies (was Re: [tlug] Re: font encoding question)
- Previous by thread: argc loop . . . . . (was: Re: [tlug] Re: font encoding question)
- Next by thread: Re: argc loop [tlug]
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links