/* Example of c-style strings. Array declaration vs. a pointer attached * to a string literal */ #include int main() { char name[20] = "Marvin Dipwart"; char * greeting = "Hello"; // points to a constant segment // of memory printf("name = %s\n", name); printf("greeting = %s\n", greeting); name[1] = 'e'; printf("name = %s\n", name); /* This statement will compile, but a runtime error will occur */ greeting[1] = 'u'; return 0; }