Höhere Programmierung in der Computerlinguistik mit C++ - Übung 1

Zurück

C++ SS11 - Übung 1 - Downcasting

Beispiel für Downcasting.

#include <iostream>

using namespace std;

int main() {
        float y = 4.4;
        float z = 4.9;
        
        char a = 'a';
        
        cout << y << " als int ->" << (int) y << endl;
        cout << z << " als int ->" << (int) z << endl;
        cout << a << " Character als int " << (int) a << endl;
}
Zurück