Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4
When you pass an argument to a function, that value has to be copied, and that costs time and memory when the object is large. A pointer stores the memory address of a value. So a function taking a pointer parameter is virtually saying: 'Look, that data I need, that's a lot of paper; please don't copy it all, just give me the link and I read the information from there directly.'
19th Apr 2019, 9:16 AM
HonFu
HonFu - avatar
+ 4
With pointers you can do alot of memory optimization
19th Apr 2019, 10:09 AM
Dragonxiv
Dragonxiv - avatar
+ 3
Pointers are very useful while doing memory locations related operations. If you have to pass a complete array at one go.. you can use pointers.
19th Apr 2019, 9:15 AM
Suraj Dhenge
Suraj Dhenge - avatar