1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mkey [24]
3 years ago
8

5)What are the differences in the function calls between the four member functions of the Shape class below?void Shape::member(S

hape s1, Shape s2);void Shape::member(Shape *s1, Shape *s2);void Shape::member(Shape& s1, Shape& s2) const;void Shape::member(const Shape& s1, const Shape& s2);void Shape::member(const Shape& s1, const Shape& s2) const;
Computers and Technology
1 answer:
Stells [14]3 years ago
5 0

Answer:

void Shape :: member ( Shape s1, Shape s2 ) ; // pass by value

void Shape :: member ( Shape *s1, Shape *s2 ) ; // pass by pointer

void Shape :: member ( Shape& s1, Shape& s2 ) const ; // pass by reference

void Shape :: member ( const Shape& s1, const Shape& s2 ) ; // pass by const reference

void Shape :: member ( const Shape& s1, const Shape& s2 ) const ; // plus the function is const

Explanation:

void Shape :: member ( Shape s1, Shape s2 ) ; // pass by value

The s1 and s2 objects are passed by value as there is no * or & sign with them. If any change is made to s1 or s2 object, there will not be any change to the original object.

void Shape :: member ( Shape *s1, Shape *s2 ) ; // pass by pointer

The s1 and s2 objects are passed by pointer as there is a * sign and not & sign with them. If any change is made to s1 or s2 object, there will be a change to the original object.

void Shape :: member ( Shape& s1, Shape& s2 ) const ; // pass by reference

The s1 and s2 objects are passed by reference  as there is a & sign and not * sign with them. If any change is made to s1 or s2 object.

void Shape :: member ( const Shape& s1, const Shape& s2 ) ; // pass by const reference

The s1 and s2 objects are passed by reference  as there is a & sign and not * sign with them. The major change is the usage of const keyword here. Const keyword restricts us so we cannot make any change to s1 or s2 object.

void Shape :: member ( const Shape& s1, const Shape& s2 ) const ; // plus the function is const

The s1 and s2 objects are passed by reference  as there is a & sign and not * sign with them. const keyword restricts us so we cannot make any change to s1 or s2 object as well as the Shape function itself.

You might be interested in
Video is a medium that's looks real anyways, but is real________________.
solniwko [45]

Answer:

in our life or in mine live but not all

4 0
3 years ago
The term ________ refers to the use of a single unifying device that handles media, internet, entertainment, and telephone needs
dezoksy [38]
The correct answer that would best complete the given statement above would be DIGITAL CONVERGENCE. The term Digital Convergence <span>refers to the use of a single unifying device that handles media, internet, entertainment, and telephone needs. Thanks for posting your question. Hope this helps. </span>
5 0
4 years ago
What is the name of the virus that appears to be a legitimate program but when opened
vivado [14]

Answer: trojan horse virus

Explanation:A trojan horse is a non-replicating program that looks legitimate, but it is actually used to perform malicious and illicit activities when launched. Attackers use trojan horses to steal a user's

personal information like password information, or they may simply use it to destroy programs or data on the hard disk.

6 0
3 years ago
Which of the following contains information about which keywords are bringing visitors to your website?
Natasha_Volkova [10]
I would go with C. but it would depend on what you have recently been studying to know for sure since lingo can change from person to person.  Good luck! :)
8 0
3 years ago
Identify the use of queue in the process of spooling output to a printer.
sashaice [31]

The queue makes sure the printer prints each sheet of paper in order.

6 0
3 years ago
Other questions:
  • Rebecca received the following e-mail from her boss: I NEED ALL EMPLOYEES TO WORK LATE ON SATURDAY. NO EXCEPTIONS! What is the m
    13·2 answers
  • Which group on the Home Tab allows you to add shapes to a PowerPoint slide?
    9·2 answers
  • Write a Program in C language using arrays:
    14·1 answer
  • People who enjoy working with their hands might enjoy a career as a/an
    9·1 answer
  • IN C++ PLEASE!!!! Define a function FilterStr() that takes a string parameter and returns "Good" if the character at index 4 in
    7·1 answer
  • I still haven't figured out how to award someone branliest will someone help me? If you explain to me how to do it i will do awa
    14·1 answer
  • Normalization works through a series of stages called normal forms. For most purposes in business database design, _____ stages
    7·2 answers
  • Which of the following is the file type of Microsoft® Publisher files?
    12·2 answers
  • . In this project, how many times will the [Drive] block be repeated?
    15·1 answer
  • State the base of correct addition of 27 + 6 =34​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!