|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Mar 2003
Città: Rimini
Messaggi: 1846
|
[C] File ed errore di windows
Il seguente codice:
Codice:
void scrivi_classifica()
{
FILE *datafile;
datafile=fopen(classifica, "w");
if(datafile==NULL)
{
printf("errore nell'apertura del file");
}
else
{
fprintf(datafile,"%s", nome);
}
fclose(datafile);
}
Il programma senza questa funzione va perfettamente. Sapete darmi qualche indicazione sul perchè possa avvenire? ps: nome è una variabile globale di tipo stringa. |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Mar 2003
Città: Rimini
Messaggi: 1846
|
Ops scusate sono andato per tentativi e ho scoperto che occorre scrivere così il comando per aprire il file.
datafile=fopen("classifica.txt", "w"); |
|
|
|
|
|
#3 | |
|
Senior Member
Iscritto dal: Apr 2003
Città: Genova
Messaggi: 4739
|
Quote:
__________________
Jappilas is a character created by a friend for his own comic - I feel honored he allowed me to bear his name Saber's true name belongs to myth - a Heroic Soul out of legends, fighting in our time to fullfill her only wish Let her image remind of her story, and of the emotions that flew from my heart when i assisted to her Fate
|
|
|
|
|
|
|
#4 | |
|
Senior Member
Iscritto dal: May 2005
Messaggi: 340
|
Quote:
logico che devi scriverlo tra " " e sopratutto scrivegli l'estensione... se ci sono 100 file chiamati classifica con estensioni diverse quale prende? uno a caso?.... |
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 17:49.



















