0

what is the difference between data type& name and data type* name?

I have write this code, and both using & and * work fine. But i don't know what they behave like. https://code.sololearn.com/c1wNINb151UA/?ref=app

13th Feb 2020, 4:41 AM
sherlockholmes
sherlockholmes - avatar
1 Answer
+ 3
type& indicates a reference, while type* indicates a pointer. In C, only pointer is available, in C++ both reference and pointer are available. I found these reads through a web search, I'm pretty sure they can and will explain better than I could, and with more details. https://techdifferences.com/difference-between-pointer-and-reference-2.html http://www.differencebetween.net/technology/difference-between-pointer-and-reference/
13th Feb 2020, 6:43 AM
Ipang