Hallo... Wie kann ich mit fstream das momentane Datum in eine Datei schreiben?
Ich will es so, wie es
date +%d-%B-%Y-%H-%M
in der Shell ausgibt.
cout<<system("date +%d-%B-%Y-%H-%M");
Gibt mir auch eben das aus.
fstream file; file.open("phile.dat",ios::out); file<<"Datum: "<<system("date +%d-%B-%Y-%H-%M")<<endl;
schreibe, steht da
Datum: 0
Ich hab's mal versucht, das ganze als Variable reinzuschreiben, das funzt aber auch nicht wirklich so :-/
mfg