been asked a question on this, basically coming up with argc...without actually having argc
if your given argv, which as I understand essentially a array of pointers to the relevant char arrays of each inputted argument,
how would I actually go about counting the number of pointers in argv?
The C standard specifies:
argv[argc] shall be a null pointer.
So you can always detect the end by testing for 0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With