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
What is intellectual property rights law ?​
kherson [118]
Intellectual property law deals with the rules for securing and enforcing legal rights to inventions, designs, and artistic works. Just as the law protects ownership of personal property and real estate, so too does it protect the exclusive control of intangible assets.
5 0
2 years ago
As a technical support rep, michael is responding to a customer's question sent to him via e-mail. what should michael's first t
hoa [83]

As a technical support rep, Michael's first task will be option b: Determine the purpose of the message he will send as a response.

<h3>Who is a technical support rep?</h3>

The role or duty of a Technical Support is known to be any person that tends to troubleshoot customer tech issues.

Note that they are said to be people who often resolve issues that are linked to computers, phones, tablets, and others.

Therefore, As a technical support rep, Michael's first task will be option b: Determine the purpose of the message he will send as a response.

Learn more about technical support  from

brainly.com/question/27366294
#SPJ1

See option

a. conduct any necessary research

b. determine the purpose of the message he will send as a response

c. Hit the "reply" button

d. start composing his reply

7 0
1 year ago
Electrical pressure is also called
fgiga [73]
Electrical pressure is also known as voltage.

I hope this helps you! :-)
3 0
3 years ago
Read 2 more answers
What are the data types used in C programming with examples
Zepler [3.9K]
I don’t really understand what you are trying to ask. Try posting a picture along with your question
5 0
3 years ago
Which shortcut keys can be used to duplicate a slide?
Leya [2.2K]

Answer:

Ctrl + D used to duplicate a slide

8 0
3 years ago
Other questions:
  • A windows computer is shared between several users, each with his own local user account. Each user has his own dedicated, uniqu
    9·1 answer
  • Constructors ________. initialize instance variables when overloaded, can have identical argument lists when overloaded, are sel
    11·1 answer
  • The unique physical address burned into every network interface card is its:
    15·1 answer
  • In regard to protective actions for explosive devices, the area where the blast originates is referred to as ___________ perimet
    8·1 answer
  • A network technician is tasked with designing a firewall to improve security for an existing FTP server that is on the company n
    9·1 answer
  • Which of the following are not parts of a message? Select all that apply.
    12·1 answer
  • The computer addicts are conscious about their addiction. True or false
    9·1 answer
  • I need le help, darn ijourneys
    10·2 answers
  • What is the next line? &gt;&gt;&gt; myTuple = [10, 20, 50, 20, 20, 60] &gt;&gt;&gt; myTuple.index(50) 3 1 4 2
    14·2 answers
  • 8. Give regular expressions with alphabet {a, b} for
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!