Question: 1. Correct the logic/syntax error in the code below to produce the correct output, WITHOUT CHANGING ITS FLOW. 2. Explain in detail the reason/concept behind

1. Correct the logic/syntax error in the code below to produce the correct output, WITHOUT CHANGING ITS FLOW.

2. Explain in detail the reason/concept behind the error.

MY CODE SAYS NO "class A " HAS NO MEMBER FUNCTION "add(), Line 22.

1. Correct the logic/syntax error in the code below to produce the

code for reference:

#include

using namespace std;

template

class A{

private:

C a,b;

public:

A (Cx,Cy){

a=x;

b=y;

}

void show(){cout

}

C add(){

C c=a+b;

return c;

}

};

int main(){

A d;

d.add();

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!