IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

 C Discussion :

[FICHIERS] Petit problème


Sujet :

C

  1. #1
    Futur Membre du Club
    Homme Profil pro
    INPRES
    Inscrit en
    Avril 2011
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : INPRES

    Informations forums :
    Inscription : Avril 2011
    Messages : 9
    Points : 8
    Points
    8
    Par défaut [FICHIERS] Petit problème
    Bonjour a tous,

    Voila j'ai un petit problème avec mon programme qui m'affiche une erreur que je ne comprend pas trop, je pense que le problème se situe dans l'ouverture et la fermeture des fichiers mais je n'en suis pas sûr ... Ce programme sert à bidonner des fichiers:

    #define _CRT_SECURE_NO_WARNINGS
    #include <stdlib.h>
    #include <stdio.h>
    #include <windows.h>
    #include <string.h>

    // Structures
    struct chantiers
    {
    long Numchantier;
    char NomChantier [25] ;
    char rue [50] ;
    int CodePostal ;
    char ville [20] ;
    char MaîtreOuvrage[30] ;
    float Montant ;
    int Durée ;
    char Gérant [3] ;
    int position ;
    } ;

    struct date
    {
    short Jour;
    short Mois;
    short Annee;
    } ;

    struct ouvriers
    {
    long NumRegistre ;
    char Nom [25] ;
    char Prenom[30] ;
    char Rue [50] ;
    int CodePostal ;
    char Ville [20] ;
    char Specialite [20] ;
    struct date d_engag ;
    struct date d_naiss ;
    } ;


    // Prototypes
    void Menu();
    void Init_Ouvriers(char *);
    void Init_Chantiers(char *);

    // Fonction principale
    void main()
    {
    int indice = 0, fini=0;
    char nom_ouvrier[25] = "Ouvriers.dat";
    char nom_chantier[25]= "Chantiers.dat";

    while (fini == 0)
    {
    Menu();
    fflush(stdin);
    scanf("%d",&indice);
    switch(indice)
    {
    case 1:
    system("CLS");
    Init_Ouvriers(nom_ouvrier);
    Init_Chantiers(nom_chantier);
    break;
    case 2:
    system("CLS");
    nom_ouvrier[0] = '\0';
    printf("Entrer le nom du fichier Ouvriers (avec l extension .dat): ");
    scanf("%s", &nom_ouvrier);
    printf("\n");
    printf("Entrer le nom du fichier Chantiers (avec l extension .dat): ");
    scanf("%s", &nom_chantier);
    Init_Ouvriers(nom_ouvrier);
    Init_Chantiers(nom_chantier);
    break;
    case 3:
    fini = 1;
    break;
    default:
    system("CLS");
    printf("Veuillez ne pas rentrer n'importe quoi .. \n");
    Sleep(1500);
    system("CLS");
    break;
    }
    }
    }

    // Fonction Menu
    void Menu()
    {
    system("CLS");
    printf("Bienvenue dans ce programme de bidonnage\n");
    printf("Que voulez-vous faire?\n");
    printf("1. Utiliser les fichiers par default\n");
    printf("2. Utilisez d'autres fichiers\n");
    printf("3. Quitter le programme\n");
    printf("Votre choix: ");
    }

    // Fonction qui cree le bidonnage du fichier ouvriers
    void Init_Ouvriers(char *Fichier_Ouvriers)
    {
    FILE *f_file;
    int i, reponse, fini = 0;
    struct ouvriers pouvrier;

    while (fini == 0)
    {
    f_file = fopen(Fichier_Ouvriers,"rb");
    if (f_file != NULL)
    {
    //fclose(f_file);
    printf("Le fichier %s existe deja\n",Fichier_Ouvriers);
    printf("Que voulez-vous faire?\n");
    printf("1. Supprimer et remplacer\n");
    printf("2. Ne pas le suprpimer\n");
    printf("Votre choix: ");
    fflush(stdin);
    scanf("%d",&reponse);
    }
    else
    {
    // fclose(f_file);
    reponse = 1;
    }
    fclose(f_file);
    switch (reponse)
    {
    case 1:
    // Initialisation de table ouvrier
    for(i = 0; i < 100; i++)
    {
    pouvrier.NumRegistre = -1;
    pouvrier.Nom[0] = '\0';
    pouvrier.Prenom[0] = '\0';
    pouvrier.Rue[0] = '\0';
    pouvrier.CodePostal = 0;
    pouvrier.Ville[0] = '\0';
    pouvrier.Specialite[0] = '\0';
    pouvrier.d_engag.Jour = 0;
    pouvrier.d_engag.Mois = 0;
    pouvrier.d_engag.Annee = 0;
    pouvrier.d_naiss.Jour = 0;
    pouvrier.d_naiss.Mois = 0;
    pouvrier.d_naiss.Annee = 0;
    }

    f_file = fopen(Fichier_Ouvriers,"wb");
    if (f_file == NULL)
    {
    perror("Probleme lors de l ouverture du fichier ouvrier\n");
    }
    else
    {
    for (i=0 ; i<100; i++)
    fwrite(&pouvrier, sizeof(struct ouvriers),1 , f_file);
    }
    fclose(f_file);

    system("CLS");
    printf("Bidonnage du fichier %s effectue",Fichier_Ouvriers);
    Sleep(1500);
    fini = 1;
    break;
    case 2:
    fini = 1;
    break;
    default:
    fini = 0;
    system("CLS");
    printf("Ne rentrer pas n'importe quoi ...");
    Sleep(1500);
    system("CLS");
    break;
    }
    }
    }

    // Fonction qui crée le bidonnage du fichier chantiers
    void Init_Chantiers(char *Fichier_Chantier)
    {
    int i, reponse, fini = 0;
    FILE *f_file;
    struct chantiers pchantier;

    while (fini == 0)
    {
    system("CLS");
    f_file = fopen(Fichier_Chantier,"rb");
    if (f_file != NULL)
    {
    //fclose(f_file);
    printf("Le fichier %s existe deja\n",Fichier_Chantier);
    printf("Que voulez-vous faire?\n");
    printf("1. Supprimer et remplacer\n");
    printf("2. Ne pas le suprpimer\n");
    printf("Votre choix: ");
    fflush(stdin);
    scanf("%d",&reponse);
    }
    else
    {
    //fclose(f_file);
    reponse = 1;
    }
    fclose(f_file);
    switch (reponse)
    {
    case 1:
    for(i = 0; i<20; i++)
    {
    pchantier.Numchantier = -1;
    pchantier.NomChantier[0] = '\0';
    pchantier.rue[0] = '\0';
    pchantier.CodePostal = 0;
    pchantier.ville[0] = '\0';
    pchantier.MaîtreOuvrage[0] = '\0';
    pchantier.Montant = 0;
    pchantier.Durée = 0;
    pchantier.Gérant[0] = '\0';
    pchantier.position = 0;
    }

    f_file = fopen(Fichier_Chantier,"wb");
    if (f_file == NULL)
    {
    perror("Probleme lors de l ouverture du fichier chantier\n");
    }
    else
    {
    for (i=0 ; i< 20 ; i++)
    fwrite(&pchantier, sizeof(struct chantiers),1 , f_file);
    }
    fclose(f_file);
    system("CLS");
    printf("Bidonnage du fichier %s effectue",Fichier_Chantier);
    Sleep(1500);
    fini = 1;
    break;
    case 2:
    fini = 1;
    break;
    default:
    system("CLS");
    printf("Ne rentrer pas n'importe quoi ...");
    Sleep(1500);
    system("CLS");
    fini = 0;
    break;
    }
    }
    }


    Voici l'erreur:

    Merci de m'aider

    SbY.

  2. #2
    Expert confirmé Avatar de ManusDei
    Homme Profil pro
    vilain troll de l'UE
    Inscrit en
    Février 2010
    Messages
    1 619
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : France

    Informations professionnelles :
    Activité : vilain troll de l'UE

    Informations forums :
    Inscription : Février 2010
    Messages : 1 619
    Points : 4 350
    Points
    4 350
    Par défaut
    Tu pourrais mettre ton code entre les balises CODE ? (le # dans l'interface)

    Et tu as oublié le message d'erreur ^^
    http://www.traducteur-sms.com/ On ne sait jamais quand il va servir, donc il faut toujours le garder sous la main

  3. #3
    Futur Membre du Club
    Homme Profil pro
    INPRES
    Inscrit en
    Avril 2011
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : INPRES

    Informations forums :
    Inscription : Avril 2011
    Messages : 9
    Points : 8
    Points
    8
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    #define _CRT_SECURE_NO_WARNINGS
    #include <stdlib.h>
    #include <stdio.h>
    #include <windows.h>
    #include <string.h>
     
    // Structures
    struct chantiers
    {
        long		Numchantier;
        char		NomChantier [25] ;
        char		rue [50] ;
        int		    CodePostal ;
        char		ville [20] ;
        char		MaîtreOuvrage[30] ;
        float	    Montant ;
        int		    Durée ;
        char		Gérant [3] ;
        int         position ;
    } ;
     
    struct date 
    { 
        short	Jour;
        short	Mois;
        short	Annee;
    } ;
     
    struct ouvriers 
    { 
         long 	NumRegistre ;
         char 	Nom [25] ;
         char 	Prenom[30] ;
         char 	Rue [50] ;
         int 	CodePostal ;
         char 	Ville [20] ;
         char 	Specialite [20] ;
         struct date d_engag ;
         struct date d_naiss ;
    } ;
     
     
    // Prototypes
    void Menu();
    void Init_Ouvriers(char *);
    void Init_Chantiers(char *);
     
    // Fonction principale
    void main()
    {
        int indice = 0, fini=0;
        char nom_ouvrier[25] = "Ouvriers.dat";
        char nom_chantier[25]= "Chantiers.dat";
     
        while (fini == 0)
        {
            Menu();
            fflush(stdin);
            scanf("%d",&indice);
            switch(indice)
            {
            case 1: 
                system("CLS");            
                Init_Ouvriers(nom_ouvrier);
                Init_Chantiers(nom_chantier);
                break;
            case 2:   
                system("CLS");
                nom_ouvrier[0] = '\0';
                printf("Entrer le nom du fichier Ouvriers (avec l extension .dat): ");
                scanf("%s", &nom_ouvrier);
                printf("\n");
                printf("Entrer le nom du fichier Chantiers (avec l extension .dat): ");
                scanf("%s", &nom_chantier);
                Init_Ouvriers(nom_ouvrier);
                Init_Chantiers(nom_chantier);
                break;
            case 3:
                fini = 1;
                break;
            default:
                system("CLS");
                printf("Veuillez ne pas rentrer n'importe quoi .. \n");
                Sleep(1500);
                system("CLS");
                break;
            }
        }
    }
     
    // Fonction Menu
    void Menu()
    {
        system("CLS");
        printf("Bienvenue dans ce programme de bidonnage\n");
        printf("Que voulez-vous faire?\n");
        printf("1. Utiliser les fichiers par default\n");
        printf("2. Utilisez d'autres fichiers\n");
        printf("3. Quitter le programme\n");
        printf("Votre choix: ");   
    }
     
    // Fonction qui cree le bidonnage du fichier ouvriers
    void Init_Ouvriers(char *Fichier_Ouvriers)
    {    
        FILE *f_file;
        int i, reponse, fini = 0;
        struct ouvriers pouvrier;
     
        while (fini == 0)
        {
            f_file = fopen(Fichier_Ouvriers,"rb");
            if (f_file != NULL)
            {
                //fclose(f_file);
                printf("Le fichier %s existe deja\n",Fichier_Ouvriers);
                printf("Que voulez-vous faire?\n");
                printf("1. Supprimer et remplacer\n");
                printf("2. Ne pas le suprpimer\n");
                printf("Votre choix: ");
                fflush(stdin);
                scanf("%d",&reponse);
             }
            else
            {
               // fclose(f_file);
                reponse = 1;
            }
            fclose(f_file);
            switch (reponse)
            {
                case 1:
                    // Initialisation de table ouvrier
                    for(i = 0; i < 100; i++)
                    {
                        pouvrier.NumRegistre = -1;
                        pouvrier.Nom[0] = '\0';
                        pouvrier.Prenom[0] = '\0';
                        pouvrier.Rue[0] = '\0';
                        pouvrier.CodePostal = 0;
                        pouvrier.Ville[0] = '\0';
                        pouvrier.Specialite[0] = '\0';
                        pouvrier.d_engag.Jour = 0;
                        pouvrier.d_engag.Mois = 0;
                        pouvrier.d_engag.Annee = 0;
                        pouvrier.d_naiss.Jour = 0;
                        pouvrier.d_naiss.Mois = 0;
                        pouvrier.d_naiss.Annee = 0;
                    }
     
                    f_file = fopen(Fichier_Ouvriers,"wb"); 
                    if (f_file == NULL)
                    {
                        perror("Probleme lors de l ouverture du fichier ouvrier\n");
                    }
                    else
                    {   
                        for (i=0 ; i<100; i++)
                            fwrite(&pouvrier, sizeof(struct ouvriers),1 , f_file);
                    }
                    fclose(f_file);
     
                    system("CLS");
                    printf("Bidonnage du fichier %s effectue",Fichier_Ouvriers);
                    Sleep(1500);
                    fini = 1;
                    break;
                case 2:
                    fini = 1;
                    break;
                default:
                    fini = 0;
                    system("CLS");
                    printf("Ne rentrer pas n'importe quoi ...");
                    Sleep(1500);
                    system("CLS");
                    break;  
            }
        }
    }
     
    // Fonction qui crée le bidonnage du fichier chantiers
    void Init_Chantiers(char *Fichier_Chantier)
    {
        int i, reponse, fini = 0;
        FILE *f_file;
        struct chantiers pchantier;
     
        while (fini == 0)
        {
            system("CLS");
            f_file = fopen(Fichier_Chantier,"rb");
            if (f_file != NULL)
            {
                //fclose(f_file);
                printf("Le fichier %s existe deja\n",Fichier_Chantier);
                printf("Que voulez-vous faire?\n");
                printf("1. Supprimer et remplacer\n");
                printf("2. Ne pas le suprpimer\n");
                printf("Votre choix: ");
                fflush(stdin);
                scanf("%d",&reponse);
             }
            else
            {
                //fclose(f_file);
                reponse = 1;
            }
            fclose(f_file);
            switch (reponse)
            {
                case 1:
                    for(i = 0; i<20; i++)
                    {
                        pchantier.Numchantier = -1;
                        pchantier.NomChantier[0] = '\0';
                        pchantier.rue[0] = '\0';
                        pchantier.CodePostal = 0;
                        pchantier.ville[0] = '\0';
                        pchantier.MaîtreOuvrage[0] = '\0';
                        pchantier.Montant = 0;
                        pchantier.Durée = 0;
                        pchantier.Gérant[0] = '\0';
                        pchantier.position = 0;
                    }
     
                    f_file = fopen(Fichier_Chantier,"wb"); 
                    if (f_file == NULL)
                    {
                        perror("Probleme lors de l ouverture du fichier chantier\n");
                    }
                    else
                    {
                        for (i=0 ; i< 20 ; i++)
                            fwrite(&pchantier, sizeof(struct chantiers),1 , f_file);                   
                    }
                    fclose(f_file);
                    system("CLS");
                    printf("Bidonnage du fichier %s effectue",Fichier_Chantier);
                    Sleep(1500);
                    fini = 1;
                    break;
                case 2:
                    fini = 1;
                    break;
                default:
                    system("CLS");
                    printf("Ne rentrer pas n'importe quoi ...");
                    Sleep(1500);
                    system("CLS");
                    fini = 0;
                    break;
            }
        }
    }

    erreur


    voila excusez moi

  4. #4
    Expert confirmé
    Avatar de Thierry Chappuis
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Mai 2005
    Messages
    3 499
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : Suisse

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Industrie Pharmaceutique

    Informations forums :
    Inscription : Mai 2005
    Messages : 3 499
    Points : 5 360
    Points
    5 360
    Par défaut
    Citation Envoyé par SbY11 Voir le message
    Revient à de nombreuses reprise et engendre un comportement indéfini. Ton programme fait essentiellement de la saisie utilisateur et le réalise de manière souvent incorrecte. Renseigne-toi dans les archives de ce forum comment faire une saisie utilisateur correcte et sure. Il y a pas mal de posts à ce sujet.

    Avec mes meilleures salutations

    Thierry
    "The most important thing in the kitchen is the waste paper basket and it needs to be centrally located.", Donald Knuth
    "If the only tool you have is a hammer, every problem looks like a nail.", probably Abraham Maslow

    FAQ-Python FAQ-C FAQ-C++

    +

  5. #5
    Futur Membre du Club
    Homme Profil pro
    INPRES
    Inscrit en
    Avril 2011
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : INPRES

    Informations forums :
    Inscription : Avril 2011
    Messages : 9
    Points : 8
    Points
    8
    Par défaut
    voila j'ai changé les fflush(stdin) mais le problème persiste toujours

    Erreur: http://files.getwebb.org/view-cre65rq0.html

  6. #6
    Modérateur
    Avatar de Obsidian
    Homme Profil pro
    Développeur en systèmes embarqués
    Inscrit en
    Septembre 2007
    Messages
    7 371
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Essonne (Île de France)

    Informations professionnelles :
    Activité : Développeur en systèmes embarqués
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2007
    Messages : 7 371
    Points : 23 626
    Points
    23 626
    Par défaut
    Bonjour,

    Quelques remarques :

    — C'est bien d'avoir ajouté les balises CODE à ton extrait, mais sache que tu peux éditer un de tes commentaires déjà postés avec le bouton « Éditer » en bas à droite de son cadre ;
    — Dans fflush(), il faut comprendre « flush » comme « tirer la chasse », c'est-à-dire que cela provoque l'envoi immédiat de données stockées en attente dans un buffer vers leur destination finale, vidant ainsi ledit buffer. Mais ça ne provoque en aucun cas leur destruction. Dans le cas de stdin, le destinataire final, c'est toi (enfin ton processus). Donc, si tu ne lis pas le buffer, il n'y aucune raison pour qu'un fflush(stdin) en vide le contenu ;
    — Il faut lire le message d'erreur et apprendre à l'interpréter. Cela fait partie du débuggage et cela représente une grosse partie du travail du programmeur. Or, qu'y est-il écrit ?

    Debug Assertion Fail

    File: f:\dd\vctools\crt_bld\self_x86\crt\src\fclose.c
    Line: 47

    Expression (stream!=NULL)

    Ce message en lui-même doit te suffire à savoir où chercher. Que peut-on en déduire ?

    — C'est une erreur se produisant à l'exécution (runtime) et non à la compilation ;
    assert() est une macro de déboguage qui vérifie qu'une condition est bien remplie à un point du programme et qui stoppe le programme dans le cas contraire. À la compilation, cette macro est remplacée entre autre par un affichage du nom du fichier source et de la ligne en cours. Donc tu vois réapparaître ces informations à l'exécution, même si tu ne disposes plus des sources ;
    — Le nom du fichier se réfère à quelque chose qui n'est pas dans ton programme, mais dans la bibliothèque C standard à l'exécution (CRT), et plus précisément dans une partie du programme définie dans le fichier « fclose.c » ;
    — L'assertion est que le flux (stream) passé ne soit pas NULL. On rappelle que NULL n'est pas un mot-clé réservé du C mais une macro généralement définie comme « (void *)0 ». Donc, c'est un pointeur ;

    Conclusion qui s'impose : il y a de fortes chances que tu appelles fclose() quelque part dans ton programme avec un pointeur non initialisé, ou remis explicitement à NULL.

    Fort de ces informations, je te laisse trouver où.

  7. #7
    Expert confirmé
    Avatar de Thierry Chappuis
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Mai 2005
    Messages
    3 499
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : Suisse

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Industrie Pharmaceutique

    Informations forums :
    Inscription : Mai 2005
    Messages : 3 499
    Points : 5 360
    Points
    5 360
    Par défaut
    Effectivement, l'appel à fclose(), par exemple ici:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    f_file = fopen(Fichier_Ouvriers,"rb");
    if (f_file != NULL)
    {
        /*...*/
     
        /* L'appel a fclose() devrait intervenir ici: */
        fclose(f_file), f_file = NULL;
    }
    else
    {
        reponse = 1;
    }
    /* C'est le mauvais endroit pour appeler fclose(), car la valeur de f_file est
        potentiellement NULL, ce qui provoque un comportement indefini 
    fclose(f_file);
    */
    est souvent positionné au mauvais endroit par rapport au test de succès de l'ouverture du fichier.

    Thierry
    "The most important thing in the kitchen is the waste paper basket and it needs to be centrally located.", Donald Knuth
    "If the only tool you have is a hammer, every problem looks like a nail.", probably Abraham Maslow

    FAQ-Python FAQ-C FAQ-C++

    +

  8. #8
    Futur Membre du Club
    Homme Profil pro
    INPRES
    Inscrit en
    Avril 2011
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : INPRES

    Informations forums :
    Inscription : Avril 2011
    Messages : 9
    Points : 8
    Points
    8
    Par défaut
    Merci beaucoup cela remarche

  9. #9
    Modérateur
    Avatar de Obsidian
    Homme Profil pro
    Développeur en systèmes embarqués
    Inscrit en
    Septembre 2007
    Messages
    7 371
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Essonne (Île de France)

    Informations professionnelles :
    Activité : Développeur en systèmes embarqués
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2007
    Messages : 7 371
    Points : 23 626
    Points
    23 626
    Par défaut
    Citation Envoyé par Thierry Chappuis Voir le message
    Effectivement, l'appel à fclose(), par exemple ici: … est souvent positionné au mauvais endroit par rapport au test de succès de l'ouverture du fichier.
    Ça aurait été mieux si tu l'avais laissé trouver… :-)

  10. #10
    Expert confirmé
    Avatar de Thierry Chappuis
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Mai 2005
    Messages
    3 499
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : Suisse

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Industrie Pharmaceutique

    Informations forums :
    Inscription : Mai 2005
    Messages : 3 499
    Points : 5 360
    Points
    5 360
    Par défaut
    Citation Envoyé par Obsidian Voir le message
    Ça aurait été mieux si tu l'avais laissé trouver… :-)
    +1, pour la prochaine fois
    "The most important thing in the kitchen is the waste paper basket and it needs to be centrally located.", Donald Knuth
    "If the only tool you have is a hammer, every problem looks like a nail.", probably Abraham Maslow

    FAQ-Python FAQ-C FAQ-C++

    +

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. petit problème avec un fichier
    Par isannie dans le forum C++
    Réponses: 2
    Dernier message: 12/05/2008, 09h49
  2. [NASM] Petits problèmes lecture de fichier
    Par Jaronimo dans le forum Assembleur
    Réponses: 1
    Dernier message: 01/05/2008, 14h56
  3. Petit problème de création de fichier
    Par cajie dans le forum Ada
    Réponses: 2
    Dernier message: 29/12/2006, 11h32
  4. Réponses: 5
    Dernier message: 04/12/2006, 17h40
  5. Réponses: 2
    Dernier message: 25/08/2006, 19h49

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo