Why can’t I use strtok directly on a string in C, and why do I need to copy it first? [duplicate]
This question already has answers here: strtok crash Not sure why its bugging (1 answer) strtok in C crashes with char pointer (1 answer) strtok program crashing (4 answers) C – Unexpected Segmentation Fault on strtok(…) (6 answers) strtok segmentation fault (8 answers) Closed last month. I don’t understand why I can’t directly strtok(argv[1], “;”) […]
Why can’t I use strtok directly on a string in C, and why do I need to copy it first? [duplicate]
This question already has answers here: strtok crash Not sure why its bugging (1 answer) strtok in C crashes with char pointer (1 answer) strtok program crashing (4 answers) C – Unexpected Segmentation Fault on strtok(…) (6 answers) strtok segmentation fault (8 answers) Closed last month. I don’t understand why I can’t directly strtok(argv[1], “;”) […]