Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If we overload operator = = for the class point as a member function , which of the following implementations is correct? Question 2 options:

If we overload operator == for the class point as a member function , which of the following implementations is correct?
Question 2 options:
a)
bool point::operator ==(const point& p)
{
return (x == p.get_x()) && (y == p.get_y());
}
b)
bool operator ==(const point& p1, const point& p2)
{
return (p1.get_x()== p2.get_x()) && (p1.get_y()== p2.get_y());
}
c)
None of these answers
d)
bool point::operator ==(const point& p)
{
return (x, y)==(p.x, p.y);
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

How are members held accountable for serving in the assigned roles?

Answered: 1 week ago