I have the following code:
#include <string.h>
int main(void) {
char *buffer = NULL, **words = NULL, *aPtr = NULL, *sPtr;
int count = 0;
buffer = strdup("The quick brown fox jumps over the lazy dog");
sPtr = buffer;
do {
aPtr = strsep(&sPtr, " ");
words[count++] = ... // missing code
} while(aPtr);
return 0;
}
I'm missing some code as you can see above... Is there any kind of strdup() that works on this situation? The strdup() function itself doesn't seem to work... If there isn't one, how can I make this piece of code work?
Pointer of pointer is headache for me...