Question: Please answer all C++ related question (1-9) for positive rate. 1. Fact Pointers are one of the low-level-of-abstraction aspects of the C/C++ programming language. T

Please answer all C++ related question (1-9) for positive rate.

1. Fact Pointers are one of the low-level-of-abstraction aspects of the C/C++ programming language. T or F? A pointer-to an object is the main memory address of the object that is pointed-to.

2. Why does it make good software engineering sense to prefer and objects to pointer-based, C-style arrays (that is, the array data structure that is built-into C/C++)?

3. Define a pointer-to-int variable named px initialized to nullptr. Note Use NULL when nullptr is not supported.

4. (Continuing 3) Write an expression-statement to set px to the address-of the int variable named x.

5. (Continuing 3) Complete the stream insertion expression shown below to output the value-of x using the pointer-to-int variable px.

cout << "x = " << << endl;

6. (Continuing 3) Define a pointer-to-pointer-to-int variable named ppx initialized to the address-of px.

7. (Continuing 6) Complete the stream insertion expression shown below to output the value-of x using the pointer ppx.

cout << "x = " << << endl;

8. Change the code segment below to make fp a pointer-to-int IO formal parameter. Note fp is a call-by-reference parameter because it is a pointer, but fp is not a C++ reference parameter.

void F(int fp)

{

fp = fp * fp;

}

int main()

{

int ap;

...

F( ap );

...

}

9. Change the code segment below to make fp a C++ reference IO formal parameter.

void F(int fp)

{

fp = fp * fp;

}

int main()

{

int ap;

...

F( ap );

...

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!