Consider the following program
#include <stdio.h>
#include <string.h>
int main() {
char *str = "This is a test.";
char *token;
token = strtok(str," ");
}
It will segfault. But if I change *str to, say, str[80], it doesn't. Why is this?
Thanks