fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Vektor {};
  5.  
  6. class Lichtstrecke; // <--- forward declaration
  7.  
  8. class Strecke
  9. {
  10. protected:
  11. Vektor _ort ;
  12. Vektor _richtung ;
  13.  
  14. /*** geschützte Konstruktoren ***/
  15.  
  16. // Initialisierungskonstruktor mit Anfangs- und Endpunkt von Objekt
  17. Strecke ( Vektor const& anfangspunkt, Vektor const& endpunkt );
  18.  
  19. public:
  20. /*** Rechenmethoden ***/
  21.  
  22. // addiert einen Vektor zu der Strecke, also zum Orts- und Richtungsvektor
  23. void operator += ( Vektor const& vek ) ;
  24.  
  25. // subtrahiert einen Vektor von der Strecke, also vom Orts- und Richtungsvektor
  26. void operator -= ( Vektor const& vek ) ;
  27.  
  28. /*** Interaktionsmethoden ***/
  29.  
  30. // gibt den Schnittpunkt von Objekt und str zurück
  31. Vektor operator & ( Strecke const& str ) const ;
  32.  
  33. /*** Rechenmethoden ***/
  34.  
  35. // gibt eine ausfallende Lichtstrecke zurück
  36. virtual Lichtstrecke operator <= ( Lichtstrecke const& lichtstrecke ) const = 0 ;
  37. } ;
  38.  
  39. int main() {
  40. // your code goes here
  41. return 0;
  42. }
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty