String literals in C are stored in read-only memory. Attempting to modify them through a pointer (like *name='X') causes undefined behavior and typically results in a segmentation fault. The correct approach is to use a character array (char name[] = "David") if you need to modify the string contents.