hi,i'm beginner for programming and i don't know how to use pointer in a c++ programming.

Recommended Answers

All 6 Replies

There are plenty of books, including online, which will cover those subjects for you. This forum is not a classroom.

hi,i'm beginner for programming and i don't know how to use pointer in a c++ programming.

Is that just a statement or are you looking for a good tutorial on pointers? First result from googling "C++ pointers tutorial" is below and is a good one.

http://www.cplusplus.com/doc/tutorial/pointers/

I've been programming since 1969 and I don't know how to use them properly either. Neither do the combined resources of Microsoft, Adobe etc, judging by the number of memory-related security errors that they keep finding in their released code.
Pointers are far too error-prone and dangerous for anyone other than a hardware-level programmer to use, so don't worry if you find them difficult.

Beside pointers, the real difficulty is memory management. When to call new() and delete(). Recent languages all come with garbage collection included and this changes everything in pointers management.

Heap memory management is not a simple issue. If you are using C++11 then look into shared_ptr, weak_ptr, and unique_ptr classes for memory management of them. For C++ reference on this subject see http://www.cplusplus.com/reference/memory/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.