I didn’t notice that Pem (to whom a hearty Welcome back! from her week at a spiritual direction workshop) has an RSS feed — that’ll help me keep up with her, so that I don’t miss posts such as “Alternatives to PowerPoint” I have different reservations to PP, but Pem makes a great point (which resonates with one of Jeff’s points about all-in-one curriculum management megalith systems): we teachers would have fits if we were obliged to use classroom time in as regimented and formulaic a way as Courseware systems typically expect us to use online instruction. Yes, many teachers don’t want to learn to use online resources (and that’s okay, a point I tried to emphasize in Nashville before somebody’s gleeful trolling provoked the “experts” controversy), and others want to work with online resources in ways that an all-encompassing system will only hamper. There’ so much yet to be discovered about how we can learn online. . . .
Posted by AKMA at May 26, 2003 12:39 PM | TrackBackNote 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: Tristram at January 13, 2004 12:30 AMWhen the machine compiles your code, however, it does a little bit of translation. At run time, the computer sees nothing but 1s and 0s, which is all the computer ever sees: a continuous string of binary numbers that it can interpret in various ways.
Posted by: Rebecca at January 13, 2004 12:31 AMBut variables get one benefit people do not
Posted by: Machutus at January 13, 2004 12:31 AMInside each stack frame is a slew of useful information. It tells the computer what code is currently executing, where to go next, where to go in the case a return statement is found, and a whole lot of other things that are incredible useful to the computer, but not very useful to you most of the time. One of the things that is useful to you is the part of the frame that keeps track of all the variables you're using. So the first place for a variable to live is on the Stack. This is a very nice place to live, in that all the creation and destruction of space is handled for you as Stack Frames are created and destroyed. You seldom have to worry about making space for the variables on the stack. The only problem is that the variables here only live as long as the stack frame does, which is to say the length of the function those variables are declared in. This is often a fine situation, but when you need to store information for longer than a single function, you are instantly out of luck.
Posted by: Martha at January 13, 2004 11:38 AMWhen a variable is finished with it's work, it does not go into retirement, and it is never mentioned again. Variables simply cease to exist, and the thirty-two bits of data that they held is released, so that some other variable may later use them.
Posted by: Conrad at January 13, 2004 11:38 AMThese secret identities serve a variety of purposes, and they help us to understand how variables work. In this lesson, we'll be writing a little less code than we've done in previous articles, but we'll be taking a detailed look at how variables live and work.
Posted by: Adam at January 13, 2004 11:39 AM