Given only the pointer-to-pointer, you must have some termination rule (a finishing known-value, such as NULL). There is no standard way to "know" a sequence length given only a base pointer to it. Ever wonder why so many functions taking sequence pointers are also provide a size_tlength ? Now you know.
The short answer is also keep a counter of each token. If you are doing this in function, you can pass a pointer to size_t and update the value with the count so that it is available back in the calling function while still allowing you to return a pointer-to-pointer-to-char. Keeping a counter also allows you to validate you do not assign more strings than you have allocated pointers.
NULL). There is no standard way to "know" a sequence length given only a base pointer to it. Ever wonder why so many functions taking sequence pointers are also provide asize_tlength ? Now you know.size_tand update the value with the count so that it is available back in the calling function while still allowing you to return a pointer-to-pointer-to-char. Keeping a counter also allows you to validate you do not assign more strings than you have allocated pointers.argvisNULL-terminated; ther is no immanent need forargc;-)