(#) include < stdio.h >
int main () {
int a = 10;
int *p;
p = &a;
//Pointer arithmetic
printf("Address p is %d\n", p); //error here
printf("Value at address p is %d\n", *p);
printf("Size of integer is %d bytes\n", sizeof(int)); //error
printf("Address p+1 is %d\n", p+1); //error as well
printf("Value at address p+1 is %d\n", *(p+1));
return 0;
}
Ok, as you see above, i am studying pointers under Objective-C. Note: This is my first time studying under Xcode version 8.3.3 using my Mac Sierra 10.12.5.
What I am experiencing in errors is that, and i quote: "Format specifies type 'int' but the argument has type 'int *' ".
Am I needing to download additional libraries or is their something i'm missing - to knock out this error?
Really appreciate the help and as well the Terminal code to help fix this error.
Please and thank you - and apologies, this is my first time using stack-over-flow question and site.