When pointers are used, when reference types are used? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

When pointers are used, when reference types are used?

7th Jun 2017, 5:03 PM
Sriram Valiveti
Sriram Valiveti - avatar
2 Answers
+ 2
In C++, pointers are specifically more often used for dynamic memory allocations. On the other hand, reference types have taken place of pointers what they do in C UDFs for passing arguments by references.
7th Jun 2017, 5:25 PM
เคฆเฅ‡เคตเฅ‡เค‚เคฆเฅเคฐ เคฎเคนเคพเคœเคจ (Devender)
เคฆเฅ‡เคตเฅ‡เค‚เคฆเฅเคฐ เคฎเคนเคพเคœเคจ (Devender) - avatar
0
Thank you for the replay. As per my knowledge reference variable are used as alias. Yes pointer are used for dynamic memory allocation but I am asking in the real time while doing a project where to use the pointer and reference.
7th Jun 2017, 5:38 PM
Sriram Valiveti
Sriram Valiveti - avatar