daily pastebin goal
51%
SHARE
TWEET

Untitled

Luis_Pedro Nov 8th, 2018 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void escreveNoFicheiroLog(char *mensagem){
  2.     time_t rawtime;
  3.     struct tm * timeinfo;
  4.     time ( &rawtime );
  5.     timeinfo = localtime ( &rawtime );
  6.     FILE *fl = fopen("log.txt", "a");
  7.     if (fl == NULL){
  8.         printf("Não foi possível criar ficheiro de log");
  9.         exit(EXIT_FAILURE);
  10.     }
  11.    
  12.     fprintf(fl,"%d: %d: %d %s \n",timeinfo->tm_hour,timeinfo->tm_min,timeinfo->tm_sec,mensagem);
  13.     fclose(fl);
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top