Modernes C++ programmieren

Okt 20, 2024

lst-0005-book.cpp

// https://godbolt.org/z/P1fn5q8z8
// Call this program with 'prog.exe > file.txt', for example. 
#include <iostream>  // cout, cerr 
int main() {
    std::cout << "Output to cout\n";       // is output after 'file.txt'
    std::cerr << "Error message!\n";       // still appears on the console
    std::cout << "Normal output again\n";  // back into the file 
}