#include <stdio.h>
#include <stddef.h>
int main() {
int count = 10, x;
int *int_pointer;
int_pointer = &count; //store adr of int
x = *int_pointer; //assign value of count
//output: the adr
printf("count's adr: %p\n", &count);
//output: the value
printf("count's value: %d\n", count);
printf("count = %i, x = %i\n", count, x);
//output: the value of the adr
printf("int_pointer's value: %p\n", int_pointer);
//output: the adr of the ptr & prevents error
printf("int_pointer's adr: %p\n", (void*)&int_pointer);
//output: value at the adr
printf("value pointed to: %d\n", *int_pointer);
//size
printf("int_pointer's size: %ld\n", sizeof(int_pointer));
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: