rgb192
asked on
pointers, references and variables in any language
Please explain the diffenence between pointers, references and variables
This is a python example but the pointers, references and variables is in c++, so I can not test
https://www.experts-exchange.com/Programming/Languages/Scripting/Python/A_6589-Python-basics-illustrated-part-2.html
Is there a way I can test.
For example w3schools.com makes it easy to type in code into a text editor
This is a python example but the pointers, references and variables is in c++, so I can not test
https://www.experts-exchange.com/Programming/Languages/Scripting/Python/A_6589-Python-basics-illustrated-part-2.html
Is there a way I can test.
For example w3schools.com makes it easy to type in code into a text editor
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Reference in the abstract sense is the value that refers to the target object (where the object can be as simple as an integer variable). The concrete implementation of a reference is the address of the target stored in another variable (speaking about compiled languages as C++, for example). If that dereferencing is done automatically, then it looks as if the extra variable did not exist and as if one worked directly with the target object. But it is only the illusion -- the access is indirect. If the dereferencing is done explicitly, then we call it a pointer.
When speaking about a pointer, we can think about both the pointer variable and the address of the target stored inside. We can think this way also when thinking about a reference. However, a reference usually mimics the target object so well that some people tend to think about it (incorrectly) as about the target object itself.
When speaking about a pointer, we can think about both the pointer variable and the address of the target stored inside. We can think this way also when thinking about a reference. However, a reference usually mimics the target object so well that some people tend to think about it (incorrectly) as about the target object itself.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for all advice.
I am starting to understand.
I am starting to understand.
ASKER
and pointer is storage space of a reference value?