COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
*
|
|
&
|
|
|
|
.
|
Detailed explanation-1: -The indirection operator (or dereferencing operator) ( * ) operates on a pointer, and returns the value stored in the address kept in the pointer variable.
Detailed explanation-2: -You use the following operators to work with pointers: Unary & (address-of) operator: to get the address of a variable. Unary * (pointer indirection) operator: to obtain the variable pointed by a pointer.
Detailed explanation-3: -When you assign a variable, you use the = symbol. The name of the variable goes on the left and the value you want to store in the variable goes on the right. Here we’ve assigned the value ‘Joe’, which is a string, to the variable first name . Now if we want to reference that variable, we can.
Detailed explanation-4: -To access members of a structure using pointers, we use the-> operator. In this example, the address of person1 is stored in the personPtr pointer using personPtr = &person1; . Now, you can access the members of person1 using the personPtr pointer.
Detailed explanation-5: -A pointer is a variable that stores a memory address. Pointers are used to store the addresses of other variables or memory items. Pointers are very useful for another type of parameter passing, usually referred to as Pass By Address.