summaryrefslogtreecommitdiff
path: root/pointer.c
diff options
context:
space:
mode:
Diffstat (limited to 'pointer.c')
-rw-r--r--pointer.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/pointer.c b/pointer.c
new file mode 100644
index 0000000..48c93ca
--- /dev/null
+++ b/pointer.c
@@ -0,0 +1,16 @@
+/* Use a pointer to assign the adderss of a variable */
+
+#include <stdio.h>
+
+int main()
+{
+ int i, *p;
+ i=10;
+ p=&i;
+ printf("The value of i is %d\n",i);
+ printf("The address of i is %p\n", &i);
+ char c = 'a';
+ printf("Char: %c\n",c);
+ return 0;
+
+}