Created
March 11, 2015 20:43
-
-
Save 98chimp/19a57176be821ab156d2 to your computer and use it in GitHub Desktop.
Pointer (Drill)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// Pointers(drill) | |
// | |
// Created by Shahin on 2015-03-11. | |
// Copyright (c) 2015 98% Chimp. All rights reserved. | |
// | |
#include <stdio.h> | |
int main(int argc, const char * argv[]) { | |
int a = 13; | |
int b = 5; | |
int c = 10; | |
int *w = &a; | |
int *x = &b; | |
int *y = &c; | |
int *z = &c; | |
*w = *w * 2; | |
*y = *y + 1; | |
z = x; | |
*z = *z + 4; | |
printf("the new values are a = %d, b = %d, c = %d", a, b, c); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment