int main()
{
int i = 0;
char *p = "abcd";
for (i = 0; i < 10000; i++) {
printf("p[%d] = %d\n", i, p[i]);
}
}
when i reached 2750, program coredump.
I know that "write" can result in segmentation fault, what about
"read"?
Thank you very much for your help.
Once you access p[6], all bets are off. You have undefined behavior.