Close. The OP is right. You cannot modify string literals. Or rather, you shouldn't try. Consider:
Code:
char *s = "point to s at a string literal";
...
alphabet( s ); /* will have the same problem... */
Here, even though we use a variable, and pass that, it still is referring to a string literal. You have to use an array, or dynamically allocate memory, fill it, and pass that...
Code:
char *s = malloc( strlen( "allocate some space" ) + 1 );
strcpy( s, "allocate some space" );
...
alphabet( s ); /* works, because 's' doesn't point at a string literal */
Or...
Code:
char s[] = "an array of stuff";
...
alphabet( s );
Quzah.