From 99001e197444ab3da417d23399314afd302bf811 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 11 Mar 2011 10:08:26 +0100 Subject: [PATCH] add array_pointers/array_pointers.c metze --- array_pointers/array_pointers.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 array_pointers/array_pointers.c diff --git a/array_pointers/array_pointers.c b/array_pointers/array_pointers.c new file mode 100644 index 0000000..e9ae482 --- /dev/null +++ b/array_pointers/array_pointers.c @@ -0,0 +1,11 @@ +#include +#include +int main(void) +{ + char msg[6] = { 'H', 'e', 'l', 'l', 'o', '\0' }; + printf("msg => %p; &msg => %p; &msg[0] => %p\n", + msg, (char *)&msg, &msg[0]); + printf("msg => %s; &msg => %s; &msg[0] => %s\n", + msg, (char *)&msg, &msg[0]); + return 0; +} -- 2.34.1