Modernes C++ programmieren

Okt 23, 2024

lst-0870-godb.cpp

//#(compile) c++; compiler:g132; options:-O3 -std=c++23; libs:-
// 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
}