Learn C memory addresses in 7 minutes

Your video will begin in 10
74 Views
Published
C memory address tutorial example explained

#C #memory #address

int main()
{
// memory = an array of bytes within RAM (street)
// memory block = a single unit (byte) within memory (house), used to hold some value (person)
// memory address = the address of where a memory block is located (house address)

char a;
char b[1];

printf("%d bytes\n", sizeof(a));
printf("%d bytes\n", sizeof(b));

printf("%p\n", &a);
printf("%p\n", &b);

return 0;
}
Category
Bro Code
Tags
Software, Jobs, programming
Be the first to comment