Skip to content

Instantly share code, notes, and snippets.

@98chimp
Created March 11, 2015 20:43
Show Gist options
  • Save 98chimp/19a57176be821ab156d2 to your computer and use it in GitHub Desktop.
Save 98chimp/19a57176be821ab156d2 to your computer and use it in GitHub Desktop.
Pointer (Drill)
//
// 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