Q:

Why the following will produce segmentation fault?

int main()
{
        char *temp = "Paras";

        int i;
        i=0;

        temp[3]='F';

        for (i =0 ; i < 5 ; i++ )
                printf("%c\n", temp[i]);

        return 0;
}

Why  temp[3]='F'; will cause segmentation fault since temp is not const?

A:

You are not allowed to modify string literals.

