![]() |
Re: OOP Training
Zitat:
Zitat:
Ich habe das in meinem Demo in meinem Klassen-Tutorial zum Beispiel so gemacht:
Delphi-Quellcode:
In C++ hatte ich das ganze, auch mal zur Übung, so gelöst:
type TTemperatur = class
private FTemperatur : double; function GetTemp: double; procedure SetTemp(Value: double); protected function C2F: double; virtual; function F2C: double; virtual; public constructor create(Value: double); property Value: double read GetTemp write SetTemp; property Celsius: double read F2C; property Fahrenheit: double read C2F; end;
Code:
class Temperatur {
private: double Celsius; double Fahrenheit; public: void PutCelsius(double Temp); void PutFahrenheit(double Temp); double C2F(void); double F2C(void); }; |
Re: OOP Training
Ja du hast Recht, aber ich hab auch geschrieben
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:35 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz