So I'm quite new to c++, and I'm really into pointers, does anyone got like, an idea on how to really get to know pointers, assignments, tasks, tutorials, ect.

Basically, my knowledge in C++, is classes, operator overloading, and like simple stuff, so if you're able to come up with something simple, and then something harder. (I primarily worked with OpenGL, and physics).

Let loose

Dani AI

Generated

A compact, practical plan that fits 's background (classes, operator overloading, OpenGL/physics) is to pair short, focused experiments that expose address/value semantics with small applied projects that map to real work. ’s emphasis on hands‑on practice and ’s suggestion to read are both useful — combine them: read a targeted section, then immediately implement a tiny experiment that proves the concept.

  • Start with raw pointer mechanics: allocate a single object and an array, observe nullptr checks, test double‑delete and use‑after‑free cases, and watch how pointer assignments affect the underlying object identity.
  • Move to ownership patterns: implement a simple RAII wrapper that manages a heap object, then compare that with a reference-counting wrapper. Track lifetime changes when moving objects between scopes.
  • Build a node‑based dynamic container and traversal routines to exercise pointer links, iterator invalidation, and deletion during traversal (this hits many subtle bugs in one project).
  • Build two small, applied projects relevant to OpenGL/physics: a texture/shader resource manager that hands out lightweight handles, and a particle system where particles are created and destroyed dynamically. Those reveal lifetime, aliasing, and performance tradeoffs.
  • Finish by replacing manual management with modern techniques: prefer RAII, unique/shared ownership patterns, and move semantics where relevant.

Common pitfalls and debugging tips: dereferencing nullptr, use‑after‑free, double delete, invalid pointer arithmetic (only within the same array/object), and pointer provenance issues. Use compiler warnings (-Wall -Wextra), AddressSanitizer/Valgrind, and debugger watchpoints to catch memory errors early. Instrument experiments with assertions and small unit tests so incorrect assumptions fail fast. This progression gives both low‑level intuition and practical patterns directly usable in OpenGL and physics code.

Recommended Answers

All 2 Replies

I think a good start would be to create a linked list. Since you don't
know templates yet, you don't have to create a template linked list.

Do you know what a linked list is?

i wud suggest u to read book by sumita arora .she is an indian author but her language is simple so beginners cud easily get it.

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.