On Thu, 01 Sep 2016 19:01:50 +0300
"Ali H. Fardan" <raiz_AT_firemail.cc> wrote:
Hey Ali,
> so I just came across this if (argc) statement and
> I'm not sure why it is placed there in the first
> pleace, I am assuming that argc is not tinkered with
> (via arg.h), but the program works well without it,
> so my question is, is this if() statement incorrect
> or it's just there because of arg.h?
arg.h tinkers with argc so that after ARGEND argc
represents the number of arguments.
Thus the "if (argc)" means "if we have any arguments".
$ tool -f farg arg
when the flag f takes a mandatory argument farg the
resulting argc for instance is 1 (and *argv points at
"arg").
I hope that explains things.
Cheers
FRIGN
--
FRIGN <dev_AT_frign.de>
Received on Thu Sep 01 2016 - 18:08:29 CEST