Skip to content

Instantly share code, notes, and snippets.

@jonathanmarvens
Created April 21, 2014 15:56
Show Gist options
  • Save jonathanmarvens/11146887 to your computer and use it in GitHub Desktop.
Save jonathanmarvens/11146887 to your computer and use it in GitHub Desktop.
A pointer example I used to show a mentee that pointers are pretty much just integers with memory addresses as values.
#include <stdio.h>
int
main(void)
{
long a = 1;
long * b = &a;
long c = (long) b;
printf("c: %ld\n", c);
printf("(* c): %ld\n", (* ((long *) c)));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment