STL
komplex.cpp
Go to the documentation of this file.
1
#include "
komplex.h
"
2
#include<iostream>
3
using namespace
std;
4
5
Komplex::Komplex
()
6
: _re(0.0), _im(0.0)
7
{
8
//ctor
9
}
10
11
Komplex::Komplex
(
double
re,
double
im)
12
: _re(re), _im(im)
13
{
14
//ctor
15
}
16
17
Komplex::~Komplex
()
18
{
19
//dtor
20
}
21
22
Komplex
Komplex::operator+
(
const
Komplex
& rhs)
const
23
{
24
Komplex
tmp(_re+rhs._re, _im+rhs._im);
25
return
tmp;
26
}
27
28
ostream&
operator<<
(ostream& s,
const
Komplex
& rhs)
29
{
30
s <<
"("
<< rhs.
Get_re
()<<
","
<<rhs.
Get_im
() <<
")"
;
31
return
s;
32
}
33
34
Komplex
operator+
(
double
lhs,
const
Komplex
& rhs)
35
{
36
// Komplex tmp(lhs+rhs.Get_re(), rhs.Get_im());
37
// return tmp;
38
return
rhs+lhs;
// Ruft Methode operator+ der Klasse Komplex
39
40
}
Komplex
Definition:
komplex.h:7
Komplex::operator+
Komplex operator+(const Komplex &rhs) const
Definition:
komplex.cpp:22
Komplex::Komplex
Komplex()
Definition:
komplex.cpp:5
Komplex::~Komplex
virtual ~Komplex()
Definition:
komplex.cpp:17
Komplex::Get_im
double Get_im() const
Definition:
komplex.h:39
Komplex::Get_re
double Get_re() const
Definition:
komplex.h:24
operator<<
ostream & operator<<(ostream &s, const Komplex &rhs)
Definition:
komplex.cpp:28
operator+
Komplex operator+(double lhs, const Komplex &rhs)
Definition:
komplex.cpp:34
komplex.h
komplex.cpp
Generated by
1.9.1