Code:
#include<stdio.h>
int main (void)
{
int number = 10;
int *pointer;
pointer = &number;
printf("The size of an int is %zu\n", sizeof(int)); /* added this line just to make sure int is 4 "bytes" */
printf("The value of var is: %d \n", number);
printf("The address of var : %p \n", pointer); /* Fixed this line here */
pointer++;
printf("The address of var : %p \n", pointer);
return 0;
}
Output:
Code:
The size of an int is 4
The value of var is: 10
The address of var : 0xffba888c
The address of var : 0xffba8890
I don't see the problem now: 0xffba888c + 4 = 0xffba8890