Modernes C++ programmieren

Okt 23, 2024

lst-0870-book.cpp

// https://godbolt.org/z/csbPMYM19 
#include <iostream>
#include <ios> // hex, dec
using std::cout; using std::endl;
int main() {
    int val = 255;
    cout << std::showbase << std::hex << val << endl;   // Ausgabe: 0xff
    cout << std::noshowbase << std::dec << val << endl; // Ausgabe: 255
}