I have a char * that is a long string and I want to create a pointer to a pointer(or pointer array). The char ** is set with the correct memory allocated and I'm trying to parse each word from the from the original string into a char * and place it in the char **.
For example
char * text = "fus roh dah
char **newtext = (...size allocated)
So I'd want to have:
char * t1 = "fus", t2 = "roh", t3 = "dah";
newtext[0] = t1;
newtext[1] = t2;
newtext[2] = t3;
I've tried breaking the original up and making the whitespace into '\0' but I'm still having trouble getting the char * allocated and placed into char**