Right, I just found out that this is correct after
going through other programs

Raiz

On 2016-09-01 19:08, FRIGN wrote:
On Thu, 01 Sep 2016 19:01:50 +0300
"Ali H. Fardan" <[email protected]> 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

Reply via email to