AKMA's Random Thoughts

October 25, 2003

Difficult Words

Before today’s half-day ATR Board meeting, we celebrated a mass for theologians, especially remembering our late friend and colleague, the former editor of ATR, Jim Griffiss.

His former colleague, Bill Petersen, told the story of a time he and Jim were commiserating after an especailly vexing encounter with an exceptionally irritating neighbor. “Petersen,” quoth Jim, a pipe clenched firmly between his teeth, “you must remember that although all interesting people are difficult, not all difficult people are interesting.”

Posted by AKMA at October 25, 2003 08:06 PM | TrackBack
Comments

Our 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: Daniel at January 12, 2004 11:29 PM

When 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: Machutus at January 12, 2004 11:30 PM

When 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: Gerrard at January 12, 2004 11:31 PM

Each Stack Frame represents a function. The bottom frame is always the main function, and the frames above it are the other functions that main calls. At any given time, the stack can show you the path your code has taken to get to where it is. The top frame represents the function the code is currently executing, and the frame below it is the function that called the current function, and the frame below that represents the function that called the function that called the current function, and so on all the way down to main, which is the starting point of any C program.

Posted by: George at January 13, 2004 09:28 AM

This back and forth is an important concept to understand in C programming, especially on the Mac's RISC architecture. Almost every variable you work with can be represented in 32 bits of memory: thirty-two 1s and 0s define the data that a simple variable can hold. There are exceptions, like on the new 64-bit G5s and in the 128-bit world of AltiVec

Posted by: Fulk at January 13, 2004 09:28 AM

Earlier 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: Janikin at January 13, 2004 09:29 AM