I also found where the magic number is in the code. main.cpp pchMessageStart defined around line 2439 or so just before the definition of ProcessMessage. You should change that to be different than any existing coins or bad things.
Basically this number will allow your coin to ignore protocol messages from other coins thus ensuring your coin's chain won't become infected with transactions and/or blocks from other chains by accident.
You should choose values that are extremely unlikely to occur in normal valid messages. It suggests values above 0x80 since values below 0x80 are valid ascii.
Choosing random values between 0x80 and 0xfe would probably be okay. It's very unlikely two coins will choose the same random numbers. I suggest the first number be between 0xf0 and 0xfe but it doesn't have to be.
The testnet magic number should be different from the normal net. The testnet magic number is set in LoadBlockIndex at the top I think. Also main.cpp.