|
| HOMEPAGE | INDICE FORUM | REGOLAMENTO | ::. | NEI PREFERITI | .:: | RSS Forum | RSS News | NEWS web | NEWS software | |
| PUBBLICITA' | | | ARTICOLI | WIN XP | VISTA | WIN 7 | REGISTRI | SOFTWARE | MANUALI | RECENSIONI | LINUX | HUMOR | HARDWARE | DOWNLOAD | | | CERCA nel FORUM » | |
24-07-2007, 11.38.38 | #1 |
Made in Japan
Top Poster
Registrato: 04-07-2001
Messaggi: 4.461
|
[C] data nel nome del file
Una cosa tipo 2007-7-24 11-35-22.txt Il formato 2007-7-24 11-35-22 riesco a stamparlo su console con: SYSTEMTIME st; GetSystemTime(&st); printf("%d-%d-%d %d-%d-%d\n" ,st.wYear,st.wMonth,st.wDay,st.wHour,st.wMinute,st .wSecond); ma non so come passarlo alla funzione fopen. Idee? |
24-07-2007, 12.30.37 | #2 |
Young Promise
Registrato: 04-02-2006
Messaggi: 2.114
|
Puoi usare la funzione sprintf() che fa lo stesso lavoro della sprintf ma anzichè mandare il risultato allo stdout lo manda ad una stringa:
Codice:
char nomefile[25]; SYSTEMTIME st; GetSystemTime(&st); sprintf(nomefile, "%d-%d-%d %d-%d-%d\n" ,st.wYear,st.wMonth,st.wDay,st.wHour,st.wMinute,st .wSecond); |
24-07-2007, 15.29.06 | #3 |
Made in Japan
Top Poster
Registrato: 04-07-2001
Messaggi: 4.461
|
Si, così funziona, grazie
|
Utenti attualmente attivi che stanno leggendo questa discussione: 1 (0 utenti e 1 ospiti) | |
Strumenti discussione | |
|
|
Discussioni simili | ||||
Discussione | Autore discussione | Forum | Risposte | Ultimo messaggio |
log di AVAST...che faccio ? | enry1 | Sicurezza&Privacy | 4 | 27-11-2008 18.38.09 |
HELP - Dato un file txt con dei nomi ogni rigo, come fare a copiare un certo file, ri | Cavallaudo | Windows 7/Vista/XP/ 2003 | 0 | 18-08-2007 19.16.41 |
[XP]Generic Host Process | sgt_hellfire | Windows 7/Vista/XP/ 2003 | 24 | 16-09-2006 14.06.59 |
[Windows XP] Problemi con il masterizzatore DVD | Qgino | Hardware e Overclock | 13 | 16-10-2005 20.11.45 |
Virus o danni al registro? | Eccomi | Sicurezza&Privacy | 21 | 23-05-2005 09.48.08 |