I have been investigating about this error that appears to me when I try to compile the following lines for example:
char cadena[] = "hola mundo";
char * div = " ";
char * token = strtok(cadena, div);
while (token != NULL){
printf("%s\n", token);
token = strtok(NULL, div);
}
and when it is executed ... it arrives at that point and the segmentation fault error appears (core dumped), I know that previously they have also dealt with the same topic, but in each one I have not been able to find a solution that allows me to use This command, what I try is in code blocks to take a string of text and divide it into tokens to verify what is entered, beforehand I appreciate your help