You, too, can escape The Meatrix.
Posted by AKMA at November 7, 2003 09:01 AM | TrackBackI'd like to think there's a yellow pill too... for those of us who want to support only ethical family farms that treat their animals humanely, produce healthy meats and eggs, preserve communities and landscapes, and prove that this kind of farming is sustainable. See American Farmland Trust, for starters.
Posted by: Jeanne at November 7, 2003 11:41 AMThis is only the latest product of PETA's marketing genii. I am still fond of their Jesus themed campaign from several years ago: http://www.jesusveg.com. Unfortunately, I didn't get it together in time to buy a t-shirt with the original logo featuring a beatific Jesus with an orange-slice nimbus.
Posted by: Micah at November 7, 2003 03:31 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: Paschall at January 13, 2004 02:11 AMEarlier I mentioned that variables can live in two different places. We're going to examine these two places one at a time, and we're going to start on the more familiar ground, which is called the Stack. Understanding the stack helps us understand the way programs run, and also helps us understand scope a little better.
Posted by: Lettice at January 13, 2004 02:11 AMThat 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: Margaret at January 13, 2004 02:11 AMBeing able to understand that basic idea opens up a vast amount of power that can be used and abused, and we're going to look at a few of the better ways to deal with it in this article.
Posted by: Agnes at January 13, 2004 09:44 AMWhen Batman went home at the end of a night spent fighting crime, he put on a suit and tie and became Bruce Wayne. When Clark Kent saw a news story getting too hot, a phone booth hid his change into Superman. When you're programming, all the variables you juggle around are doing similar tricks as they present one face to you and a totally different one to the machine.
Posted by: Leonard at January 13, 2004 09:45 AMTo address this issue, we turn to the second place to put variables, which is called the Heap. If you think of the Stack as a high-rise apartment building somewhere, variables as tenets and each level building atop the one before it, then the Heap is the suburban sprawl, every citizen finding a space for herself, each lot a different size and locations that can't be readily predictable. For all the simplicity offered by the Stack, the Heap seems positively chaotic, but the reality is that each just obeys its own rules.
Posted by: Winifred at January 13, 2004 09:45 AM