Finished a review on time.
Went grocery shopping.
Helped straighten up before dinner.
Jacob and Angela came over.
Duke won!
Prepared for adult class about St. Paul tomorrow morning.
Duke won what? Are they in that little tournament again?
Posted by: Tripp at March 23, 2003 07:14 AMYes, that little tournament. Come out of your hole, Tripp; THIS is reality!
Enjoy it while it lasts, AKMA. . . I don't expect them to make it through next weekend. UK, on the other hand... (^_^)
Posted by: Jane at March 23, 2003 07:42 AMUgh, because UK is playing my alma mater, U of U. I'll say this with a lot of hope..."Go Utes!"
Posted by: Heidi at March 23, 2003 03:27 PMNote first that favoriteNumbers type changed. Instead of our familiar int, we're now using int*. The asterisk here is an operator, which is often called the "star operator". You will remember that we also use an asterisk as a sign for multiplication. The positioning of the asterisk changes its meaning. This operator effectively means "this is a pointer". Here it says that favoriteNumber will be not an int but a pointer to an int. And instead of simply going on to say what we're putting in that int, we have to take an extra step and create the space, which is what does. This function takes an argument that specifies how much space you need and then returns a pointer to that space. We've passed it the result of another function, , which we pass int, a type. In reality, is a macro, but for now we don't have to care: all we need to know is that it tells us the size of whatever we gave it, in this case an int. So when is done, it gives us an address in the heap where we can put an integer. It is important to remember that the data is stored in the heap, while the address of that data is stored in a pointer on the stack.
Posted by: Dudley at January 13, 2004 10:20 AMOur next line looks familiar, except it starts with an asterisk. Again, we're using the star operator, and noting that this variable we're working with is a pointer. If we didn't, the computer would try to put the results of the right hand side of this statement (which evaluates to 6) into the pointer, overriding the value we need in the pointer, which is an address. This way, the computer knows to put the data not in the pointer, but into the place the pointer points to, which is in the Heap. So after this line, our int is living happily in the Heap, storing a value of 6, and our pointer tells us where that data is living.
Posted by: Florence at January 13, 2004 10:20 AMSince the Heap has no definite rules as to where it will create space for you, there must be some way of figuring out where your new space is. And the answer is, simply enough, addressing. When you create new space in the heap to hold your data, you get back an address that tells you where your new space is, so your bits can move in. This address is called a Pointer, and it's really just a hexadecimal number that points to a location in the heap. Since it's really just a number, it can be stored quite nicely into a variable.
Posted by: Mildred at January 13, 2004 10:20 AM