+ 6

{ANSWERED}& and *(Pointers)

What are & and * before variable's name?I know a good bit of java, so if you can co-relate, that would be awesome.Thanks

24th Apr 2017, 10:21 AM
Meharban Singh
Meharban Singh - avatar
4 Answers
+ 5
pointers are used in c++ to do what java does automatically when passing an object as the argument of a function: pass by reference. That's the closest analogy with Java that comes to my mind.
24th Apr 2017, 7:15 PM
seamiki
seamiki - avatar
+ 12
this will definitely help you :D http://www.cplusplus.com/doc/tutorial/pointers/ hope this help 😁😁😁
24th Apr 2017, 10:27 AM
Leon lit
Leon lit - avatar
+ 8
Thanks @seamiki
24th Apr 2017, 7:20 PM
Meharban Singh
Meharban Singh - avatar
+ 2
For saving memory adresses
24th Apr 2017, 11:22 AM
Saqib Khan
Saqib Khan - avatar