ciao a tutti^^ avrei un problemino..stavo guardando in rete come scrivere su file una certa ora:
codice:
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char *argv[])
{
fstream f_out;
time_t a;
struct tm *b;
int i;
int tempo;
time(&a);
b = localtime(&a);
f_out.open("ciao.txt", ios::app);
if(f_out.fail())
{
cout << "errore apertura file";
}
f_out << asctime(b);
f_out.close();
system("PAUSE");
return EXIT_SUCCESS;
}
mm, grazie all'if di fallimento, ho notato che non riesce ad aprire il file, sbaglio forse la path??
l'ho messa giu anche così ma non funzia C:\Dev-Cpp\progetti\ciao.txt, se tolgo le ("") mi da errore.