tags:

views:

84

answers:

4

I'm moving from C# to C++, one of priority topic for me is pointer. I'm reading some book and some blog post about pointer and I understand its basic concept. Now I want to learn about pointer by practicing it.

I try to search on google, unfortunately not thing found. Are there anything can help me study and practices on C++ pointer?

A: 

I would agree with GMan's comment that a good C++ book is the way to go to do this properly.

Aside from that the most important thing when learning pointers in C++ is to use smart pointers. These can be found in the appropriate boost library. Using these from the outset will save you much pain in the future.

Also boost is a GREAT resource for any C++ programmer and you should familiarise yourself with it.

radman
Just want to mention that while smart pointers take out the chore of pointer management, you still need to know C++ pointers very well, in order to use smart pointers correctly. If the word "pointer" sounds scary, try think of it as "reference" or "handle". To help yourself learn pointers, find a textbook on Data Structures and Algorithms, and do the exercises using pointers. Also, familiarize with the "reference counting" concept early on.
rwong
+2  A: 

Just google for "learn C pointers". For example, you'll find stuff like http://computer.howstuffworks.com/c20.htm

Once you understand what a pointer is, what it does, and how it is managed, start using C++ smart pointers which take care of some of the grunt work for you.

Ben Voigt
+1 for this instead of radman's answer: When learning C++, you should definitely learn the ins and outs of pointers and how to manipulate them before you delegate pointer handling to smart pointers....IMHO :)
Duracell
I agree that understanding the fundamentals of pointers is important. But I think it is more important to get used to the idiom of smart pointers from the outset, to avoid bad habits. Obviously doing both at the same time would be ideal.
radman
A: 

There is a very good book by an Indian Author by name Yashawant Kanetkar THe book is Understanding Pointers in C.

Even though the examples will be in C it is worth to learn using this book http://www.amazon.com/Understanding-Pointers-C-Yashavant-Kanetkar/dp/8176563587

ckv