consolidate all repos to one for archive
This commit is contained in:
63
semester_2/programiranje_2/primeri/Example22/main.cpp
Normal file
63
semester_2/programiranje_2/primeri/Example22/main.cpp
Normal file
@@ -0,0 +1,63 @@
|
||||
#include <iostream>
|
||||
#include "Complex.h"
|
||||
|
||||
int main() {
|
||||
const Complex i(0,1);
|
||||
Complex c1(1,1);
|
||||
Complex c2, c3, c4;
|
||||
|
||||
i.plus(c1).print();
|
||||
i.operator+(c1).print();
|
||||
(i+c1).print();
|
||||
/*
|
||||
Complex* ptrc = new Complex(1,0);
|
||||
ptrc->plus(c1).print();
|
||||
ptrc->operator+(c1).print();
|
||||
//(ptrc+c1).print();
|
||||
(*ptrc+c1).print();
|
||||
delete ptrc;
|
||||
*/
|
||||
/*
|
||||
std::cout << "-----------------------" << std::endl;
|
||||
c2=c1+i; //c2.operator=(c1.operator+(i));
|
||||
c2.print();
|
||||
*/
|
||||
/*
|
||||
std::cout << "------------------" << std::endl;
|
||||
c2 = c1 + 1; //c2.operator=(c1.operator+(1));
|
||||
c2.print();
|
||||
//c3 = 2 + 1; //c3.operator=(3);
|
||||
//c3.print();
|
||||
//c4 = 1 + c1; // 1.operator+(c1) // operator+(1, c1)
|
||||
//c4.print();
|
||||
*/
|
||||
/*
|
||||
std::cout << "------------------" << std::endl;
|
||||
c2.print();
|
||||
c4 = c1 + 1;
|
||||
c4.print();
|
||||
if (c2 == c4)
|
||||
std::cout << "Complex numbers are equal" << std::endl;
|
||||
else
|
||||
std::cout << "Complex numbers are not equal" << std::endl;
|
||||
*/
|
||||
/*
|
||||
std::cout << "------------------" << std::endl;
|
||||
Complex c5, c6;
|
||||
c1.print();
|
||||
c4 = c1 + 1;
|
||||
c5 = c4;
|
||||
c4.print();
|
||||
c5.print();
|
||||
//c6=c5=c4+c1;
|
||||
//c5.print();
|
||||
//c6.print();
|
||||
*/
|
||||
/*
|
||||
std::cout << "------------------" << std::endl;
|
||||
c1.print();
|
||||
(++c1).print(); //c1.operator++()
|
||||
(c1++).print(); //c1.operator++(int)
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user