Skip to content

Instantly share code, notes, and snippets.

@JIElite
Last active October 31, 2015 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JIElite/634f18ba9e2648b48585 to your computer and use it in GitHub Desktop.
Save JIElite/634f18ba9e2648b48585 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(){
int a[10] = {0, 10, 20, 30, 40, 50, 60, 70, 80, 90};
int *p = &a[5];
printf("The address of &a[5]:\t%p\n", &a[5]);
printf("The value of p :\t%p\n", p);
printf(" *p : %d\n", *p);
printf(" p : %p\n", p);
printf(" *p + 1 : %d\n", *p + 1);
printf(" p + 1 : %p\n", p + 1);
printf(" *(p + 1) : %d\n", *(p + 1));
printf(" *(p - 1) : %d\n", *(p - 1));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment