We haven't talked much about memory this far but I want to talk about it here because it will be the
theme of the next three sections.
We talked earlier that variables have a location in memory which is accessed by their name or identifier.
Well we can think of memory being like a big long list of memory cells.
Each one byte and size and each one with its own unique address.
Each cell can be located in memory using this unique address.
So the address 1001 would be right after the address 1000.
So in my mind I have a picture of what a cell really looks like.
In fact this is kind of how I think of variables in general.
So we have this kind of first slot which is the address portion says a beer one thousand one or 1000
or whatever the address may be.
And then here you have the value of what it is say we made some kind of X equals to 5 like this.
Well this index has an address of some kind.
We don't know exactly what that is but the value would be five year right.
OK.
So of course different types have different sizes so an integer would be for these cells but really
I just think of it as one big cell with an address and one value.
So remember that there are no guarantees where your variables are stored but we can actually get the
address of a variable.
So let me just show you how to do that.
So we have our variable x.
And if we just say seek out the address
X is in.
We do this we say ampersand and X and if we run this you'll see what the address is.
So it's this big long bizarre kind of looking thing.
Those those if you've seen this before.
No this is hexadecimal.
K so this single edge ampersand is known as the address of operator and we can do this with any variable
to get its address.
So here this is actually just an integer
but know that the address is not considered an integer type so we don't really know what the type is
yet but we'll see this in the next lecture.