diff --git a/E-Memory-Pointers/code/pointer_demo.c b/E-Memory-Pointers/code/pointer_demo.c new file mode 100644 index 0000000..8d4c35d --- /dev/null +++ b/E-Memory-Pointers/code/pointer_demo.c @@ -0,0 +1,26 @@ +//Pointer demo +//Gustaf Ahdritz +//COMS 3157 + +void foo_1(int x, int *z){ + x++; + + int a = *z; + + a++; +} + +int main(){ + int x = 5; + int y = 7; + int *z = &y; + + printf("The value of z is: %p\n", z); + + foo_1(x, z); + + printf("The value of x is %d\n", x); + printf("The value at address z is %d\n", *z); + + return 0; +}