Commit 6e135d00 authored by Hans Buchmann's avatar Hans Buchmann

ziele 10.12.20

parent 88d125f5
......@@ -4,5 +4,4 @@ vincent.rigter@students.fhnw.ch;marvin.tritz@students.fhnw.ch;kim.schenk@student
BB
alper.arslan@students.fhnw.ch;roger.syfrig@students.fhnw.ch;marco.meier5@students.fhnw.ch;marc.friedli@students.fhnw.ch;lars.zihlmann@students.fhnw.ch;joelle.hoechle@students.fhnw.ch;cedric.achermann@students.fhnw.ch;maurice.steiner@students.fhnw.ch;nicola.perrin@students.fhnw.ch;marc.bischoff@students.fhnw.ch;johnny.jordi@students.fhnw.ch;philippe.wiedmer@students.fhnw.ch;yanlung.hauser@students.fhnw.ch;joshua.hirsbrunner@students.fhnw.ch;rolf.haberstich@students.fhnw.ch;sandro.good@students.fhnw.ch;philippe.schenk@students.fhnw.ch;daniele.sentina@students.fhnw.ch;laxen.sivarajah@students.fhnw.ch;yannick.hmina@students.fhnw.ch;fabio.franz@students.fhnw.ch
......@@ -15,7 +15,9 @@ class Point
//non default constructor
Point(const Point& other); //copy constructor
~Point(); //destructor no parameters
double distance(Point& other); //other is a c++ reference
double distance(const Point& other) const;
//| |--- my own variables cannot be changed
//other cannot be changed
static double distance(Point p,Point q);
private:
......@@ -50,14 +52,17 @@ double Point::distance(Point p,Point q) //is not a member of Point
// |private
}
double Point::distance(Point& other) //is a member of Point
double Point::distance(const Point& other) const //is a member of Point
// |----------c++ reference
{
/* hack
other.xc=0;
other.yc=0;
/* hack
other.xc=0; error
other.yc=0; error
*/
/* other hack
xc=0; error
yc=0; error
*/
return std::hypot(xc- other.xc,
yc- other.yc);
}
......@@ -99,6 +104,16 @@ constructor of Point 6,8
d=5
destructor of Point 6,8
destructor of Point 3,4
*/
/*
with other as const c++ reference
distance cannot change the variable of instance
constructor of Point 3,4
constructor of Point 6,8
d=5
destructor of Point 6,8
destructor of Point 3,4
*/
......
......@@ -95,3 +95,10 @@
- C++ Referenz
- keyword ``const``
## 10.12.2020
- Prüfung besprechen
- 6-cia: Folien Seite 14-19
- `class Line`
- constructor
- by value vs. by reference
......@@ -95,5 +95,12 @@
- pointer Referenz
- C++ Referenz
- keyword ``const``
## 10.12.202
- Prüfung besprechen
- 6-cia: Folien Seite 14-19
- `class Line`
- constructor
- by value vs. by reference
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment