I have this code:
char *pch;
pch = strtok(texto," ");
while (pch != NULL)
{
pch = strtok (NULL, " ");
}
My "texto" variable have something like "This is my text example".
And i need to store each value comming from pch in while, in an array of characteres, but i really dont know how to do it.
I need something like that, each value in array will have a word, so:
"This is my text example".
Array[0][20] = This;
Array[1][20] = is;
Array[2][20] = my;
Array[3][20] = text;
Array[4][20] = example;
The pch
in while having all these words already split, but I don't know how to add into a char array, or how I will declare him too.