tags:

views:

286

answers:

9

I do not understand pointers. Where can I learn more about them?

+3  A: 

try http://home.netcom.com/~tjensen/ptr/pointers.htm

Maurice Kroon
THANKS MAURICE KROON
CHAN
ITS SUPERB........... :)
CHAN
This reminds me of this entry on german-bash.org: "Hey, please press the key labeled 'Caps lock' on your keyboard" - "WOW THANKS NOW IT IS MUCH EASIER"
schnaader
this is very good.
Dervin Thunk
+6  A: 

The best way to understand pointers is to write assembly, I found.

Pod
+1 - there's quite a bit of truth to this. Pointers are dead simple if you understand what's going on behind the scenes. I learned assembly on a Cosmac and later a BBC micro some years before I first touched C. With that grounding pointers are a no-brainer.
ConcernedOfTunbridgeWells
Actually, technically I learned machine code on a Cosmac - it didn't have an assembler.
ConcernedOfTunbridgeWells
Thelimitations of any assembler language force you to deal with addresses all the time and so you simply *have* to become comfortable with them to do anything whatsoever. Every higher-level language abstracts away from this to some degree, C probably least of all. This is one of the reasons C is often referred to as a "structured assembler".
Dale Hagglund
ps: The assembly you'll have easiest access to - x86, is probably the worst to begin learning. Every compiler out there uses quite messy syntax and the CISC instructions are pretty odd to my mind. My first assembly that I got involved in to any real degree was ARM (using this[1] tool -- not sure how appropriate it is for home nistallation/use). I would really recommend ARM, PIC, MIPS over x86. I'm not aware of any specially designed assembly "teaching" language ala Pascal. Maybe try the From Nand to Tetris[2]?[1]http://brej.org/kmd/ [2]http://www1.idc.ac.il/tecs/
Pod
Pod, that 2nd link you gave looks really good, can't wait to try it out.
Spidey
I've not tried it myself (I found out about it after 3 years in a Computer Engineering degree -- which essentially does the exact same thing, just in more detail). I just saw a video of a presentation by the guy. It looked great.
Pod
+2  A: 

Richard Buckland's lecture about pointers is highly recommendable.

anderstornvig
Great resource, thanks.
Spidey
have you guys actually watched this? Good gosh, the dude us a smooth talker but he hasn't programmed in his whole life... he just knows the material by heart... wow.
Dervin Thunk
My favorite is at 14.55, when he talks about memory addresses and dereferencing... do you think he's ever done this before in a real program?
Dervin Thunk
A: 

I personally like the quite straightforward cplusplus.com tutorial on pointers.

Matthew Iselin
A: 

My C language bible is "C-The complete Reference" by Schildt. Chapter 5 is all about pointers.

If you just think of the pointer as being the address of something - like the address in a letter telling you how to find the house - then you will be most of the way there.

Ian
A: 

Deitel & Deitel C how to program C++ version of the book preview on Google Books

Amro
A: 

Pointers on C (Paperback) by Kenneth Reek (Author)

http://www.amazon.com/Pointers-C-Kenneth-Reek/dp/0673999866

plan9assembler
+1  A: 

I can't believe that nobody has posted the obligatory Pointers video. It's a bit of fun, while still being informative.

IRBMe
A: 

Lot's of great references suggested. I'd just like to add one thing:

Play with them!

Once you understand them on the theoretical level from the books, articles, lectures, videos above then you should set yourself to some task that that will allow you to make mistakes, find those mistakes and fix mistakes.

Think about implementing something like a linked list (double or singly linked), binary tree, or similar data structure. Then write some code to insert and remove values from your structure. In completing the task you'll definitely feel more comfortable with them, and get some experience debugging pointer problems.

John Carter