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
If i hit the delete key three times what will be left
pogonyaev

Answer:

planation:

I got this

6 0
2 years ago
Host A sends a packet of length 1,100 bytes to host B over a link with transmission rate 4 Mbps over a distance 1300 km, propaga
ArbitrLikvidat [17]

Answer:

please mark me brainlist

Explanation:

6 0
3 years ago
4.8% complete this is a single choice question; skip ahead to question content a b c d confirm difficulty level: moderate an int
PilotLPTM [1.2K]

Answer:

A replay attack

4 0
2 years ago
50 points please!!
MA_775_DIABLO [31]

Answer:

poopypoopypoopypoopy

6 0
3 years ago
Shadow and highlight create depth (3D).<br> TRUE OR FALSE
tamaranim1 [39]

Answer:

true because then it would be like not popping out

7 0
2 years ago
Other questions:
  • In what ways are Outlook notes useful for personal or professional use? Check all that apply.
    13·2 answers
  • If you have a mix of 32-bit and 64-bit versions of windows, which architectures should you add a unattended installation file fo
    7·1 answer
  • Alison wants to add her company name at the bottom of every page in her document. Which option should she use?
    11·2 answers
  • Write the include directive that allows use of the function headers in the file myFuncs.h.
    13·1 answer
  • . double x = 5; declares that x is a...............variable.
    14·1 answer
  • Which segment of society introduced the grunge look?
    5·2 answers
  • Write a class named Accumulator containing: An instance variable named sum of type integer. A constructor that accepts an intege
    14·1 answer
  • What is thought to have caused the extinction of the dinosaurs?
    13·1 answer
  • What is the<br> binary code<br> for<br> "DMS"?
    8·1 answer
  • 1 point
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!