Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
C
#include
int main() { int myVal = 13; printf("Value of integer 'myVal': %d\n", myVal); printf("Size of integer 'myVal': %lu bytes\n", sizeof(myVal)); // 4 bytes printf("Address to 'myVal': %p\n", &myVal); printf("Size of the address to 'myVal': %lu bytes\n", sizeof(&myVal)); // 8 bytes return 0; } //C
C result:
Value of integer 'myVal': 4
Size of integer 'myVal': 4 bytes
Address to 'myVal': 0x7ffd87ddb7c4
Size of the address to 'myVal': 8 bytes