Archive for the Data structures Category

One of the hardest concepts in the C programming language for me is Pointers. To this day I still often have to look into my text books when I’m diving deep into pointer world. Hopefully this tutorial will help demystify pointers for you.

What are Pointers?
Pointers got their name for one reason: they “point” to locations in memory. Pointers are just variables that store memory addresses, usually the addresses of other variables. With this memory address you’ll then be able to go to that address and retrieve the data stored in it. If you happen to have a large of data that you want to pass into a function it’s a lot easier to pass its location to the function than to copy every element of the data.

(more…)

I honestly can’t recall the number of times I’ve been asked what the difference was between arrays and linked lists. There’s been countless times when people have come up to me and asked “When should I use arrays and when should I use linked lists?” Since I’m getting tired of answering this so many times I felt I should write down my answer here :P
(more…)