This question may sound strange to you, but I am learning C++ all by myself. I have nobody whom I could ask for mentoring and I would be very glad for some advice.
I have started recently to program in C++ (about 3 - 4 intensive months with about 6 - 8 daily hours). My background is Java and I have done some bigger projects in Java with over 10k LOC (which is for a university student like me big).
I used C++ mainly for algorithms implementing and visualization but I aim for bigger software projects as well. The only libraries I used are for Catch2, OpenCV, and a little Boost. The strange thing about my programming style is that I have never used pointers in my journey; it is not like I don't know how to use pointers but I just never found a moment where I think a pointer would be useful. When I have to store primitive data, I prefer std::vector over array. When I need to use an object of a class, I prefer to create the object on the stack and pass it by reference; no new/delete, no smart pointers.
The reason why I ask this (strange) question is, that I feel like I am missing a big area of C++ programming. Could you share with me your experience and maybe give me some tips? https://www.telldunkin.one/
It sounds like you are doing thing correctly. You should avoid pointers when possible and use the things you mention above.
Pointers are needed when you create an object in one function, return the object to the calling function, and dispose of the object later on. The function in which the object was created goes out of scope long before the created object is no longer needed, so dynamic allocation is required, and passing the pointer around is the only way to access the object.
However, when doing something like this, consider using the smart pointers provided in the std:: library. std::unique_ptr and std::shared_ptr. These classes act like pointer, but also make sure memory is properly deleted when all pointers to that object go out of scope.
It sounds like you are doing thing correctly. You should avoid pointers when possible and use the things you mention above.
This.
Deep down, a std::vector is "just a pointer", but it has thick coat of syntactic sugar on it. Sweet.
Iterators "point to elements" very much like pointers.
Runtime polymorphism, the thing that you can achieve with class inheritance, is where you are most likely to get close to pointers -- at least smart ones.
if you do not need pointers, and do not use them, you are doing it right.
containers make DIY dynamic memory and home-grown containers a thing of the past in c++, and you should be using the provided tools.
but, even with containers, pointers to existing data (not dynamic memory) or function pointers etc can make some types of code much easier to write or more efficient etc.
there are also a number of occasionally useful constructs that c++ does not implement for you. You can use someone else's code, and that is fine, but if you had to do your own tree or graph, you may find pointers suddenly very handy (you can do these without pointers; trees packed into vectors are often more efficient than pointer built trees but there are times when the pointers are needed or wanted).
I guess how I would state it is:
use pointers when you need them, with the exception of using dynamic memory (calls to new and delete). If you find yourself playing with dynamic memory, try to find a way to avoid that if possible (if building your own container for something not implemented in the language is the only major thing I can think of where you would need dynamic memory, and even there, I would take a long hard look at using a built in container instead if at all possible to redesign it that way).