hello, how do u loop a pointer to a string char** something and retrieve the value ?
hello, how do u loop a pointer to a string char** something and retrieve the value ?
hmm i think i got it. u need a reference to how many items are stored within the array right?
solved thanks. a counter is needed.
Not necessarily - you could loop until the string pointed to is null.
We see this problem rise up with argc and argv, where argv is the collection of arguments stored as char** and argc acts as the counter of arguments in the char**.
Incidentally, argv also has a null pointer as its last element (i.e., argv[argc]).
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Yes.Is it specified by the standard?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
The C library was pretty much built around NULL terminated strings. It's silly to not use a NULL char unless you have a very sepcial reason and right now I don't know such a reason.
It's mostly safe to assume that 99% of the strings are NULL terminated.