Class Komplex + STL
Loading...
Searching...
No Matches
komplex.cpp
Go to the documentation of this file.
1
#include "
komplex.h
"
2
#include <iostream>
3
#include <vector>
4
using namespace
std;
5
6
// Methoden der Klasse Komplex
7
8
Komplex::Komplex
()
9
:
Komplex
(0.0,0.0)
// constructor forwarding
10
{}
11
12
Komplex::Komplex
(
double
re,
double
im)
13
: _re(re), _im(im)
14
{}
15
16
Komplex
&
Komplex::operator+=
(
const
Komplex
& rhs)
17
{
18
_re += rhs._re;
19
_im += rhs._im;
20
return
*
this
;
21
}
22
23
// Ende: Methoden der Klasse Komplex
24
// -------------------------------------------------------------------------
25
// Funktionen, welche die Klasse Komplex als Datentyp benutzen
26
27
ostream&
operator<<
(ostream& s,
const
Komplex
& rhs)
28
{
29
s <<
"("
<< rhs.
Get_re
()<<
","
<<rhs.
Get_im
() <<
")"
;
30
return
s;
31
}
32
33
istream&
operator>>
(istream& s,
Komplex
& rhs)
34
{
35
double
a,b;
36
s >> a >> b;
37
rhs =
Komplex
(a,b);
38
return
s;
39
}
40
Komplex
Definition
komplex.h:8
Komplex::Komplex
Komplex()
Definition
komplex.cpp:8
Komplex::Get_im
double Get_im() const
Definition
komplex.h:49
Komplex::operator+=
Komplex & operator+=(const Komplex &rhs)
Definition
komplex.cpp:16
Komplex::Get_re
double Get_re() const
Definition
komplex.h:32
operator<<
ostream & operator<<(ostream &s, const Komplex &rhs)
Definition
komplex.cpp:27
operator>>
istream & operator>>(istream &s, Komplex &rhs)
Definition
komplex.cpp:33
komplex.h
komplex.cpp
Generated on Thu May 8 2025 11:53:59 for Class Komplex + STL by
1.9.8