Here's a list made by someone who likes to pretend he's an expert (me):

1. Overthinking them. Forgetting that pointers are just like every other variable. They store a value, that's all. Just like everything else in C.
2. Confusing pointers and arrays. They aren't the same. They're similar. Like twins, they are similar, but not the same person.
3. Making them hard to read. (typedefing pointers) It seems like a neat thing to do, but it's really not. It confuses point #1.
4. Not freeing what you allocate. Sure, your compiler will probably take care of it. It doesn't have to, but it probably will. But it makes your code ugly, and it bugs me.

The using them uninitalized really goes for any variable, it's not just a "pointer thing", so I'm not including it in my list. But I agree with freeing what you allocate. I've never seen dangling pointers as a problem, simply because I stop using them when I know I've freed them. I also don't consider returning the address of local variables a "dangling pointer". Also, pointer maths are not really a common thing to mix up in my use of it. Most people don't randomly add or subtract them. You tend to increment or decrement by one, and that's that. It's uncommon for you to apply random math to them.

But for a quick go, that's probably my list. The main thing I see people have a problem with is simply understanding that pointers are just variables. They just hold a value.


Quzah.