summaryrefslogtreecommitdiff
path: root/pointer.c
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-02-06 11:26:44 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2017-02-06 11:26:44 -0500
commit97a693d996c79fb2a008b19750d8bb45512e01a2 (patch)
tree6df17bfe7de7c59f7b1083828d71a91e61fae9fa /pointer.c
downloadengr0016-97a693d996c79fb2a008b19750d8bb45512e01a2.tar.gz
engr0016-97a693d996c79fb2a008b19750d8bb45512e01a2.tar.bz2
engr0016-97a693d996c79fb2a008b19750d8bb45512e01a2.zip
Inital commitHEADmaster
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;
+
+}