Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

argc loop . . . . . (was: Re: [tlug] Re: font encoding question)



"Stephen J. Turnbull" wrote:

>   for (i = 0; i <= argc; ++i)
>     printf ("There's nothing wrong with Unicode for Japanese.\n");

Even though there is no harm since argv[argc] is a null pointer 
and *argv[argc] is not accessed, "<= argc" is fingernails on a 
chalkboard, neverminding the novel use of argc to control non-argv stuff. 

If one is going to loop on argc, the C idiom is preferred: 

    for (i=0;i<argc;i++)

Also tolerable, but less readable, would be: 

    while (*argv++!=(char *)0)



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links