AKMA's Random Thoughts

May 15, 2003

Safe On Arrival

Well, Blogaria can stop holding its collective breath — David Weinberger arrived safely, and didn’t even evade the vulpine perception of my somewhat dazed sixteen-year-old son when I sent Si into O’Hare to escort David to the car. (AKMA to Pippa, while they waited in the car in the “Do Not Wait Here Under Any Circumstances” No Stopping Zone: “Wait a minute — I sent Si in there. He’ll get lost; he’ll never find David!”)

But everything turned out okay, and we’ve dropped David off in his suite to prepare for the intense technological grilling he’ll receive from Seabury’s students and faculty.

The ride into Evanston from O’Hare was delightful; David told us — well, I can’t repeat that, or David would have to kill me. And then — well, I shouldn’t say. Really, you had to be there.

Posted by AKMA at May 15, 2003 02:44 PM | TrackBack
Comments

Ha! Liveblogging will be th erule of teh day. I am not wireless, however, so I claim dibbs on the outlet in the west wall!!!

Posted by: Tripp at May 15, 2003 02:59 PM

Does one have to be marinaded before a technological grilling? Is this a pot-luck? What a good idea...

Posted by: Paul at May 15, 2003 03:51 PM

Truly sorry I won't be there for this one, AKMA. It's been a great series, for which you (and Seabury) should be commended widely.

Posted by: Eric Sinclair at May 15, 2003 04:48 PM

Let's see an example by converting our favoriteNumber variable from a stack variable to a heap variable. The first thing we'll do is find the project we've been working on and open it up in Project Builder. In the file, we'll start right at the top and work our way down. Under the line:

Posted by: Annabella at January 13, 2004 01:03 AM

This will allow us to use a few functions we didn't have access to before. These lines are still a mystery for now, but we'll explain them soon. Now we'll start working within the main function, where favoriteNumber is declared and used. The first thing we need to do is change how we declare the variable. Instead of

Posted by: Grace at January 13, 2004 01:03 AM

Note 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: Elias at January 13, 2004 01:04 AM

That gives us a pretty good starting point to understand a lot more about variables, and that's what we'll be examining next lesson. Those new variable types I promised last lesson will finally make an appearance, and we'll examine a few concepts that we'll use to organize our data into more meaningful structures, a sort of precursor to the objects that Cocoa works with. And we'll delve a little bit more into the fun things we can do by looking at those ever-present bits in a few new ways.

Posted by: Charles at January 13, 2004 11:20 AM

But some variables are immortal. These variables are declared outside of blocks, outside of functions. Since they don't have a block to exist in they are called global variables (as opposed to local variables), because they exist in all blocks, everywhere, and they never go out of scope. Although powerful, these kinds of variables are generally frowned upon because they encourage bad program design.

Posted by: Silvester at January 13, 2004 11:21 AM

This will allow us to use a few functions we didn't have access to before. These lines are still a mystery for now, but we'll explain them soon. Now we'll start working within the main function, where favoriteNumber is declared and used. The first thing we need to do is change how we declare the variable. Instead of

Posted by: Jerman at January 13, 2004 11:22 AM