summaryrefslogtreecommitdiff
path: root/modifying-a-string-literal.c
diff options
context:
space:
mode:
Diffstat (limited to 'modifying-a-string-literal.c')
-rw-r--r--modifying-a-string-literal.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/modifying-a-string-literal.c b/modifying-a-string-literal.c
new file mode 100644
index 0000000..bebabbf
--- /dev/null
+++ b/modifying-a-string-literal.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+int main(void)
+{
+ char *s = "foo";
+ s[0] = 'b';
+ puts(s);
+}