c++ a. Which arithmetic operations can be performed on pointers? 1. Multiplicati
ID: 3737057 • Letter: C
Question
c++
a. Which arithmetic operations can be performed on pointers?
1.
Multiplication, division, addition, and subtraction
2.
All arithmetic operations that are legal in C++
3.
Only multiplication and addition
4
Addition , subtraction , preincrement, and postincrement
5.
None of the above
b. A function may return a pointer, but the programmer must ensure that the pointer ________.
1.
has not previously been returned by another function
2.
has been assigned an address
3.
is pointing to an object that is still valid after the return of the function
4.
was received as a parameter by the function
5.
None of the above
c. A pointer may be initialized with ________.
1. the value of a floating-point variable
2. the address of an existing object of the appropriate type
3. the value of a floating-point constant
4. All of the above
5. None of the above
d. The statement double *num; ________.
1. initializes a variable called *num
2.defines a variable of type double called num
3.defines a pointer variable called num
4.defines and initializes a pointer variable called num
5.None of the above
e. The term pointer can be used interchangeably with ________.
1. variable
2. address
3. counter pointer
4. decimal pointer
5. None of the above
Explanation / Answer
Ans:a
Option 4 is correct.
In pointer we can perform Addition , subtraction , preincrement, and postincrement operations.
==============================================================
Ans:b
Option B is correct.
==============================================================
Ans: c
Option B is correct.
Ex:
int a = 10;
int *b = &a // pointer initializtion here pointer b is pointing to address of a variable.
=================================================================
Ans:d
Option 3 is correct.
double *num /defines only not initialized
=================================================================
Ans:
Option 2 is correct.
A pointer points to an address in memory.
==================================================================
Kindly Check and Verify Thanks..!!!
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.