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
Schach [20]
4 years ago
6

Explain by details operator overloading in C++ with example

Computers and Technology
1 answer:
dimaraw [331]4 years ago
8 0

Answer:

Operator overloading is used to extend the functionality of an operator like +(addition),-(subtraction),/(Division),*(Multiplication).

Syntax for operator overloading inside the class :-

You have to use operator keyword.

Function

return type operator <operator sign> (arguments)

{

     ---code

}

suppose you want to extend the functionality of ++ operator for any integer so that it increases the value by two.

void operator ++(int &a)

{

    a=a+2;

}

So whenever this operator is used with an argument it will increase the value to that argument by 2.

int a=5;

++(a);

a will become 7;

You might be interested in
What is true about music from the Romantic period?
avanturin [10]
The answer to the given question above is the third option: <span>It was longer and less constrained than the music of the Classical period. The Romantic Period in music actually has more freedom in design and form. During this period, music were even more artistic and intellectual as well. Romantic Period occurred the late 18th century until early 19th century.</span>
8 0
3 years ago
Read 2 more answers
What is the definition of assiduous?
LuckyWell [14K]

Answer:

showing great care and perseverance.

6 0
3 years ago
Read 2 more answers
What i have to care about transmitting data packet from one controller to other controller?
Nata [24]
You, nothing! The <span>Network is responsible of </span>transmission<span> of </span>data<span> from </span>one<span> device to </span>another<span> device</span><span>.</span>
3 0
4 years ago
Supose that there are exactly 733 monks in the world.
kramer

A statement which is true about the monks is that: There is a day of the year that is the birthday of at least 3 monks.

<h3>What is a conditional statement?</h3>

A conditional statement can be defined as a statement that can be written to contain both a hypothesis and conclusion. Thus, it typically has the form "if P then Q."

Where:

P and Q represent sentences.

<h3>What is a converse statement?</h3>

A converse statement can be defined as a type of statement that is obtained by switching (reversing) the hypothesis and conclusion of a conditional statement. This ultimately implies that, the converse of a statement is obtained by switching (reversing) the hypothesis and  conclusion of a conditional statement.

In this context, we can reasonably infer and logically deduce that a statement which is true about the monks is that there is a day of the year that is the birthday of at least 3 monks because a year only has 365 days.

Read more on conditional statement here: brainly.com/question/16951916

#SPJ1

Complete Question:

Suppose that there are exactly 733 monks in the world.

Which one of the following statements is true about the monks?

Every day of the year, it's a monk's birthday.

There is a day of the year that is the birthday of exactly 3 monks

There is a monk who celebrates his birthday on a Tuesday

There is a day of the year that is the birthday of at least 3 monks

Some monk turns years at the weekend

None of the above.​

5 0
2 years ago
Advantages of communications​
poizon [28]

Answer:

promotes team building

creates better relationship

3 0
3 years ago
Read 2 more answers
Other questions:
  • You are designing a VPC for a small application. It will operate in a private subnet and needs internet access to software updat
    6·1 answer
  • These statements describe the NOS.(choose all that applies)
    13·2 answers
  • Describe a time when you influenced someone else’s knowledge around technology, whether it be an app, a new gadget, etc. What di
    14·1 answer
  • What does aperture control? A)amount of light the image sensor captures when taking a photo. B)how sensitive the camera is to in
    10·2 answers
  • Random integer between 3 and 13 (inclusive)
    8·2 answers
  • An IT systems engineer creates a new Domain Name System (DNS) zone that contains pointer (PTR) resource records. Which zone type
    15·1 answer
  • WILL GIVE BRAINLIEST!!!!!
    8·1 answer
  • Databases, authentication, and user accounts are all part of a website's ______________.
    9·1 answer
  • ________is the most popular public key algorithm available and can be used for digital signatures, key exchange, encryption, and
    10·2 answers
  • To freeze rows 1 and 2, and columns 1, 2, and 3, which cell should you highlight before selecting freeze panes?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!