summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2014-07-04 16:36:33 +0200
committerVolker Hoffmann <volker@cheleb.net>2014-07-04 16:36:33 +0200
commit4740bc01d07140f66868ea22b809dd4d74ad2b20 (patch)
tree1b3a0f99cb48268dd4ef7e978f537d93a0065e94
parentc2de57c043b93477a4fd01fbcaa364ec469134b2 (diff)
pointers are arrays and vice versa
-rw-r--r--pointerWtf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pointerWtf.c b/pointerWtf.c
new file mode 100644
index 0000000..05738b1
--- /dev/null
+++ b/pointerWtf.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+int main() {
+ printf("%c\n", "ABCDEFG"[4]);
+ printf("%c\n", 4["ABCDEFG"]);
+ return 0;
+}
+