I know this question is probably a duplicate, but I haven't found an answer that really states why should I use one over the other as they most likely will yield the same result. My question is when to use Pass by reference and when to use Pass by Pointer to a c++ functions.
Asked
Active
Viewed 51 times
0
-
2First rule of pointers: Don't use pointers. ;) Other than that it really depends on use-case, but try to avoid pointers if you can. – Some programmer dude Oct 01 '18 at 07:37
-
@Ahmed refer it here https://stackoverflow.com/questions/52177329/differences-between-passing-by-reference-and-passing-by-address/52253504#52253504 – Sanjeev Oct 01 '18 at 08:53
-
thanks for the help – Ahmed Oct 01 '18 at 16:04