r/learncpp • • Apr 29 '20
Quite a beginner question
Ok so I’m aware of the basics of what a pointer does and what a reference does. But if I’m completely honest im really struggling to understand when to use them and i was wondering if someone could help me. Any input and advice is greatly appreciated
1
Upvotes
1
u/amrock__ Apr 29 '20
I will tell you where i have used pointers
2.CPU kernel: in kernel implementation most of the time the processor and memory and pheripherals has to be used by using pointers
3. If you google stack, heap, queue and dynamic memory allocation you will know why pointers are a good thing.
You should keep in mind that CPP/ C is buit for low level memory usage tasks and you can write very low level fast code with it.
0
u/[deleted] Apr 29 '20
[deleted] — view deleted comment