+ 1

Difference between passing by reference and passing by pointers in c++

I've searched the difference but i couldn't understand these items , i can understand about pointers but not reference : can you give an example for them please? 1. Pointers: The dereferencing operator * gives the value of the variable. Reference: Value can be implicitly referenced using the reference name. 2. Pointer: Can point to nothing, null or empty. Reference: Has to be initialized during declaration. 3. Pointer : Uses ‘&’ to reference the address of variable. Reference: Using &, we can get the address of reference (because the address is the same as that of the original variable)

5th Mar 2020, 4:52 PM
Armina
Armina - avatar
2 Antworten
5th Mar 2020, 5:42 PM
rodwynnejones
rodwynnejones - avatar
+ 1
Coder Kitten rodwynnejones Thanks for a million. You healped me alot.
5th Mar 2020, 5:55 PM
Armina
Armina - avatar