+ 2
Pointers and pointing too.
Hey, Whats the diffrents between pointers and pointing too please? i know java dosent support pointers but i dont really know what it is as i havent done c++ i know java still points to things tho like methods so whats the diffrence please.
1 Answer
+ 4
Pointers are variables that store the memory addresses of other variables. Pointing is the act of storing (pointing to) an address within the pointer. ex:
int x =0;
int *p; â> pointer p
p=&x; â> pointing at address of x
cout << p << endl; â> prints xâs address
cout << *p; â> prints x
& is dereferencing operator; when used in conjunction with a pointer think âaddress ofâ. The example is from c++, this concept is one of the reasons that c and c++ are so powerful.