Question: C++ program Tasks Assume the following structure declaration exists for Questions 1-5: struct Rectangle { int length; int width; }; 1. Write a function that

C++ program
Tasks Assume the following structure declaration exists for Questions 1-5: struct Rectangle { int length; int width; }; 1. Write a function that accepts a Rectangle structure as its argument and displays the structure's contents on the screen. 2. Write a function that uses a Rectangle structure reference variable as its parameter and stores the user's input in the structure's members. Class/Semester: BCS/2 7 3. Write a function that returns a Rectangle structure. The function should store the user's input in the members of the structure before returning it. 4. Write the definition of a pointer to a Rectangle structure. 5. Assume rptr is a pointer to a Rectangle structure. Which of the expressions, A, B, or C, is equivalent to the following expression: rptr->width a) *rptr.width b) (*rptr).width c) rptr.(*width)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
