This commit is contained in:
RafayAhmad7548 2024-06-16 18:53:25 +05:00
parent 37776af5db
commit ab03d5f10c
4045 changed files with 286212 additions and 3 deletions

View file

@ -0,0 +1,65 @@
/*
Rafay Ahmad
23I-2526
*/
#include <iostream>
using namespace std;
class Complex{
int real;
int img;
public:
Complex(){}
Complex(int real, int img) : real(real), img(img){}
Complex operator++(int){
Complex temp(*this);
real++;
img++;
return temp;
}
friend Complex operator++(Complex const &c){
}
Complex operator--(int){
Complex temp(*this);
real--;
img--;
return temp;
}
Complex operator--(){
real--;
img--;
return *this;
}
friend Complex operator+(Complex const& c1, Complex const& c2){}
void print(){
cout<<real<<" + i"<<img<<endl;
}
};
Complex operator+(Complex const& c1, Complex const& c2){
Complex res;
res.real = c1.real + c2.real;
res.img = c1.img + c2.img;
return res;
}
Complex operator++(Complex const& c){
c.real++;
c.img++;
return *this;
}
int main(){
Complex c1(1, 2);
Complex c2(2, 3);
Complex c3 = c1++;
c1.print();
c3.print();
return 0;
}