summaryrefslogtreecommitdiff
path: root/const.c
diff options
context:
space:
mode:
Diffstat (limited to 'const.c')
-rw-r--r--const.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/const.c b/const.c
new file mode 100644
index 0000000..8b1e502
--- /dev/null
+++ b/const.c
@@ -0,0 +1,15 @@
+#include <u.h>
+#include <libc.h>
+
+char *p = "gooseberry";
+char a[] = "gooseberry";
+
+void
+main()
+{
+ print("%s\n%s\n", p, a);
+ strncpy(p, "black", 5);
+ strncpy(a, "black", 5);
+ print("%s\n%s\n", p, a);
+ exits(nil);
+}