Poly
Poly
class Complex {
private:
float real;
float imag;
public:
// Operator overloading
Complex temp;
return temp;
void display() {
cout << "Real: " << real << " Imaginary: " << imag << endl;
};
int main() {
Complex c3;
c3 = c1 + c2;
c3.display();
return 0;
}
#include <iostream>
class Base {
public:
void display() {
};
public:
void show() {
void display() {
};
int main() {
Base* basePtr;
Derived d;
basePtr = &d;
return 0;