Here's what I got:
char ***tokens;
*tokens=(char**)malloc((5)*sizeof(char*));
*tokens[4]=(char*)malloc((4)*sizeof(char));
And I got "Program received signal SIGSEGV, Segmentation fault." At the third line.
The thing is, this is okay:
*tokens[0]=(char*)malloc((4)*sizeof(char));
And this is okay too:
*tokens[1]=(char*)malloc((4)*sizeof(char));
But this gives me segmentation fault:
*tokens[2]=(char*)malloc((4)*sizeof(char));
Or any number bigger than 2, why is that when the array should have a length of 5?
The idea is that I have a pointer that points to an array, each set of the array points to a string, so I can do something like this:
*tokens[0]="string";
And
(*tokens[0])[m]='s';