R
Richard
Andrew Poelstra said:Andrew said:Thanks Richard I know I can always count on you. I wondered about
argc and its uses.
In addition to argc, argv is also NULL terminated (IIRC!), so
you can loop through it without needed argc to find out when
to stop.
while(*argv)
{
process(*argv);
++argv;
}
I'm not sure that is safe. Check whether argv[0] can be a NULL.
Oops! The first line should be
while(argv)
or
while(argv != NULL)
..without the dereference.
No. With the dereference. Not a typo so a fundamental misunderstanding
of the basic use of pointers there. I can only assume beer has been
consumed :-;