Related questions with answers
What does the indirection operator do?
Solutions
VerifiedA pointer is a variable which holds the address of another variable,
so all operations like addition, subtraction, ... etc, deal with the
address value, not the item pointed by the pointer.
And if you want to deal with the item itself, C++ defines an operator
called indirection operator, which is an asterisk [ * ]
before the pointer, that dereferences the pointer enabling dealing
with the item. for example,
int x=5,*ptr = &x;
cout<<ptr; // prints the address of the pointer
cout<<*ptr; // prints the value pointed by the pointer [5]
Like other data values, memory addresses, or pointer values, can be stored in variables of the appropriate type. A variable that stores an address is called a pointer variable, but is often simply referred to as just a pointer. The asterisk before the variable name indicates that variable is a pointer variable. Because the asterisk allows you to pass from a pointer to the variable being pointed to, it is called .
Create a free account to view solutions
Create a free account to view solutions
Recommended textbook solutions

Computer Organization and Design MIPS Edition: The Hardware/Software Interface
5th Edition•ISBN: 9780124077263 (6 more)David A. Patterson, John L. Hennessy
Starting Out with C++: Early Objects
8th Edition•ISBN: 9780133360929Godfrey Muganda, Judy Walters, Tony Gaddis
Fundamentals of Database Systems
7th Edition•ISBN: 9780133970777Ramez Elmasri, Shamkant B. Navathe
Introduction to Algorithms
3rd Edition•ISBN: 9780262033848 (3 more)Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. CormenMore related questions
- computer science
- chemistry
- differential equations
1/4
- computer science
- chemistry
- differential equations
1/7