โ† Mentor Graphics questions

Identify segmentation fault in string literal modification code

Filed under Mentor Graphics

The question

Explain why attempting to modify a character of a string literal via a pointer (e.g., *str='E') compiles but causes a segmentation fault at runtime.

No write-up yet. Related questions below have one.

Related Mentor Graphics questions

Collected from public candidate posts and coding forums. Updated Nov 2026.