int main() { // haengt den String "foobar" an die Datei test.txt an std::ofstream out("test.txt", std::ios_base::app); out << "foobar" << std::endl; out.close();
// liest den ersten Buchstaben aus der Datei test.txt std::ifstream infile("test.txt"); char a; infile.get(a); std::cout << a << std::endl; }
-- All parts should go together without forcing. ... By all means, do not use a hammer. (IBM maintenance manual, 1925)