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 :

projet c vecteur extensible


Sujet :

C

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Nouveau membre du Club
    Inscrit en
    Novembre 2007
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Novembre 2007
    Messages : 5
    Par défaut projet c vecteur extensible
    Salut à tous, je travaille depuis quelque jours sur un projet pour la fac.
    Je dois insérer des éléments (caracteres ou entiers) pris sur l'entrée standard dans un vecteur pour les trier et afficher ensuite par ordre numérique et lexicographique.
    Pour l'instant je n'arrive pas à me défaire des erreurs de segmentation core dumped lors de l'exécution ^^
    Si quelqun a une idée ...
    merci d'avance!

    ****Le projet.c*****

    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
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    #include <stdlib.h>
    #include <stdio.h>
    #include <stdbool.h>
    #include "memoire.h"
    #include "chaine.h"
    #include <string.h>
    #include "projet.h"
    #include <assert.h>
     
    #define TAILLE_BLOC 4
    #define INDICE_DERNIER self->nombre_d_elements-1  // à voir
    static bool type_valeur; //true si entier
     
    struct tas
    {
      void **vecteur;
      int taille_physique;
      int nombre_d_elements;
      int taille_rallongement;
      void (*liberer)(void *);
      void (*afficher)(void *);
    };
     
    tas
    tas_creer(void)
    {
      printf("Entree dans la fonction tas_creer\n");
      tas self=memoire_allouer(sizeof(struct tas));
      self->vecteur=NULL;
      self->taille_physique=0;
      self->nombre_d_elements=0;
      self->taille_rallongement=1;
      self->liberer=NULL;
      self->afficher=NULL;
      return self;
      printf("Sortie de la fonction tas_creer\n");
    }
     
    static void
    definir_liberation(tas self)
    {
      printf("Entree dans la fonction definir_liberation\n");
      self->liberer=memoire_liberer; //ou tas_liberer seul? oumemoire_liberer, suivis d'un tas_liberer() dans appliquer ordre à la fin?
      printf("Sortie de la fonction definir_liberation\n");
    }
     
    void
    tas_liberer(tas self)
    {
      printf("Entree dans la fonction tas_liberer\n");
        void **p = self->vecteur;  
        unsigned int n = self->nombre_d_elements; 
     
        if (self->liberer != NULL)
        {
    	while (n > 0)  
    	{
    	    if (*p != NULL) 
    		self->liberer(*p); 
    	    p++; 
    	    n--; 
     
    	}
        }
        memoire_liberer(self->vecteur);
        memoire_liberer(self);
        printf("Sortie de la fonction tas_liberer\n");
    }
     
    static void
    definir_affichage(tas self, void (*selectionner_affichage)(void *))
    {
      printf("Entree dans la fonction definir_affichage\n");
      self->afficher=selectionner_affichage;
      printf("Sortie de la fonction definir_affichage\n");
    }
     
    void
    tas_afficher(tas self, int option)
    {
      printf("Entree dans la fonction tas_afficher\n");
      if (self->afficher != NULL)
        {
          printf("[");
          tas_iterer(self, self->afficher, option);
          printf("[");
        }
      else
        printf("[...]");
      printf("Sortie de la fonction tas_afficher\n");
    }
     
    void
    selectionner_affichage(void *s)//ATTENTION iterer_jusqua envoi un epointeur sur entier ou pointeur sur chaine
    {
      printf("Entree dans la fonction selectionner_affichage\n");
      if (type_sommet(s) == 1)
        afficher_entier(s);
      else
        afficher_chaine(s);
      printf("sortie de la fonction selectionner_affichage\n");
    }
     
    int
    tas_nombre_d_elements(tas self)
    {
      printf("entree dans al fonction tas_nombre_d_elements\n");
      return self->nombre_d_elements;
      printf("Sortie de la fonction tas_nombre_d_elements\n");
    }
     
    void
    tas_iterer_jusqua_inverse(tas self, void (*fonction)(void *), int n)
    {
      printf("Entree dans al fonction tas_iterer_jusqua_inverse\n");
        unsigned int i = 0;
        void **v = self->vecteur;
     
        while (i < n)
        {
    	fonction(v[i]);
    	i++;
        }
        printf("Sortie de la fonction tas_iterer_jusqua_inverse\n");
    }
     
    void
    tas_iterer_jusqua(tas self, void (*fonction) (void *), int n)
    {
      printf("Entree dans la fonction tas_iterer_jusqua\n");
      unsigned int i=0;
      void **v=self->vecteur;
      while (n > i)
        {
          fonction(v[n-1]);
          n--;
        }
      printf("Sortie de la fonction tas_iterer_jusqua\n");
    }
     
    void
    tas_iterer(tas self, void (*fonction)(void *), int option)
    {
      printf("Entree dans la fonction tas_iterer\n");
      if (option < 0)
        tas_iterer_jusqua_inverse(self, fonction, tas_nombre_d_elements(self));
      else
        tas_iterer_jusqua(self, fonction, tas_nombre_d_elements(self));
      printf("Sortie de la fonction tas_iterer\n");
    }
     
    char *
    chaine_lire(void) 
    {
      int taille=TAILLE_BLOC;
      char *tampon=memoire_allouer(taille * sizeof(*tampon));
      printf("dans chaine_lire : Entree dans la boucle pour\n");
      int i=0;
      for(char c=getchar(); c!=EOF || c!='\n'; c=getchar())         //ajouter c!='\n'? oui à priori
        {
          if (c == '\n')
    	{
    	  tampon[i++]=c;
    	  break;
    	}
          tampon[i]=c;
          i++;
          if(i >= taille)//était ==
    	{
    	  taille=taille*2;
    	  tampon=memoire_reallouer(tampon, (taille) * sizeof(*tampon)); 
    	}
        }
      printf("La chaine suivante a ete enregistree : %s \n", tampon);
      printf("Dans chaine_lire : sortie de la boucle pour\n");
      return tampon;
    }
     
    static void
    tas_vide(void)
    {
      printf("Le tas est vide, plus rien a faire!\n");
      exit(EXIT_FAILURE);
    }
     
    int
    compter_nombre_mots(const char *s)
    {
      //printf("Debut fonction compter_nombre_mots\n");
      int compteur=1;
      char *p=strchr(s, ' ');
      while ( p != NULL)
        {
          compteur++;
          p=strchr(p+1, ' ');
        }
      //printf("fin fonction compter nombre mots\n");
      return compteur;
    }
     
    static void
    rallonger(tas self, unsigned int nouvelle_taille)
    {
      printf("Entree dans la fonction rallonger\n");
        self->vecteur = memoire_reallouer(self->vecteur,
    				      nouvelle_taille*sizeof(void *));
        memset(self->vecteur + self->taille_physique, 
    	   0, 
    	   (nouvelle_taille - self->taille_physique)*sizeof(void *));
        self->taille_physique = nouvelle_taille;
        printf("Sortie de la fonction rallonger\n");
    }
     
    static int
    nouvelle_taille(tas self, int n)
    {
      printf("Entree dans la fonction nouvelle_taille\n");
      int taille=self->taille_physique;
      while ((n+self->nombre_d_elements)>taille)
        {
          taille+=self->taille_rallongement;
          self->taille_rallongement*=2;
        }
      printf("Sortie de la fonction nouvelle_taille\n");
      return taille;
    }
     
    void 
    tas_ajouter(tas self, void *valeur)
    {
      printf("Entree dans la fonction tas_ajouter\n");
      tas_ecrire(self, self->nombre_d_elements, valeur);
      printf("Sortie de la fonction tas_ajouter\n");
    }
     
    void
    tas_ecrire(tas self, int i, void *valeur)
    {
      printf("Entree dans la fonction tas_ecrire\n");
      assert(i >= 0);
      if (i >= self->taille_physique) //ATTENTION voir avec récup entrée stdr si neccessaire idem pour rallonger ...
        {
          rallonger(self, nouvelle_taille(self, i));
        }
      self->vecteur[i] = valeur;
      if (self->nombre_d_elements < i+1)
        self->nombre_d_elements = i+1;
      printf("Sortie de la fonction tas_ecrire\n");
    }
     
    bool
    type_sommet(void *s)
    {
      printf("Entree dans la fonction type_sommet\n");
      type_valeur=true;
      char *tmp=s;
      while (*tmp != '\0' && tmp != NULL && *tmp != '\n') //était *tmp != ' ' et plus tard était != '\n'
        {
          if (*tmp > '9' || *tmp < '0')
    	{
    	  printf("S est une chaine de caracteres!\n");
    	  type_valeur=false;
    	  break;
    	}
          tmp++;
        }
      //printf("type_valeur vaut : %d\n", type_valeur);
      printf("Sortie fonction type_sommet\n");
      return type_valeur;
    }
     
    static int*
    pointeur_sur_entier(int i)
    {
      printf("Entree dans la fonction pointeur_sur_entier\n");
      int *a=memoire_allouer(1*sizeof(*a));
      *a=i;
      printf("Sortie de la fonction pointeur_sur_entier\n");
      return a;
    }
     
    //sinon 12 donnerait (1*1 +2*10 =21)
    static int
    caractere_en_entier(char *s) 
    {
      printf("Entree dans la fonction caractere_en_entier\n");
      int entier;
      entier=atoi(s);
      printf("Le nombre resultant est %d\n", entier);
      printf("Sortie de la fonction caractere_sur_entier\n");
      return entier;
    }
     
    int
    tas_decaller(tas self, void *s)
    {
      printf("Entree dans la fonction tas_decaller\n");
      int indice=recherche_position(self, s); //pos du premier indice à décaller compris.
      for (int i=INDICE_DERNIER; i>= indice; i--)
        self->vecteur[i+1]=self->vecteur[i];
      printf("Sortie de la fonction tas_decaller\n");
      return indice;
    }
     
    void
    inserer_valeur(tas self, void *s)
    {
      printf("Entree dans la fonction inserer_valeur\n"); 
      if (self->nombre_d_elements == 0)
        {
          printf("Le vecteur est pour l'instant vide\n");
          tas_ajouter(self, s);
          printf("premier element du tas : %p\n", self->vecteur[0]);
        }
      else
        {
          int indice=tas_decaller(self, s);
          tas_ecrire(self, indice, s);
          if (type_valeur == true)
    	printf(" %d eme element du tas : %d\n", indice+1, *((int *)self->vecteur[indice]));
          else
    	printf(" %d eme element du tas : %s\n", indice+1, (char *)self->vecteur[indice]);
        }
      printf("Sortie de la fonction inserer_valeur\n");
    }
     
    int
    recherche_position(tas self, void *s)
    {
      printf("Entree dans la fonction recherche_position\n");
      int indice;
      if (type_valeur == true)
        {
          int i=0;//premier à décaller.
          while ((*(int *) s) <= (*((int *) (self->vecteur[i]))) && (i < self->nombre_d_elements) && 'a' < *((char *) self->vecteur[i]) && *((char *) self->vecteur[i]) < 'Z') 
    	{
    	  printf("Dans la boucle while\n");
    	  printf("Valeur du vecteur comparee : %d\n", *(int *)(self->vecteur[i]));
    	  i++;
    	}
          printf("Le sommet entier sera place a la position %d\n", i);
          printf("Sortie de la fonction recherche_position\n");
          return i;
        }
      else
        {
          indice=comparaison_chaine(self, (char *)s);
          if (indice == -1)
    	{
    	  return INDICE_DERNIER+1; //pour insérer à la suite du vecteur.
    	  printf("Sortie de la fonction recherche_position\n");
    	}
        }
      printf("Sortie de la fonction recherche_position\n");
      return indice;
    }
     
    char *
    en_majuscules(char *s)
    {
      printf("Entree dans la fonction en majuscules\n");
      while (*s != '\0')
        {
          if (*s > '0' && *s < '9')
    	{
    	  s++;
    	  continue;
    	}
          else
    	{
    	  *s+=-'a'+'A'; // à voir syntaxe!
    	  s++;
    	}
        }
      printf("La nouvelle chaine en majs est : %s\n", s);
      printf("Sortie de la fonction en_majuscules\n");
      return s;
    }
     
    int
    comparaison_chaine(tas self, char *s1)
    {
      printf("Entree dans la fonction comparaison_chaine\n");
      char *s=memoire_allouer(sizeof(*s1));
      s=en_majuscules(s);
      int resultat;
      for (int i=0; i<= self->nombre_d_elements-1; i++)//penser à appliquer la fonction nombre_d_elements.
        {
          printf("Entree dans la boucle for de la fonction comparaison_chaine\n");
          char *p=(char *)(self->vecteur[i]);
          p= en_majuscules(p); // à vérifier si pas *p= ou p=
          resultat=comparer(s, p);
          if (resultat == 1)
    	{
    	  printf("Sortie de la fonction comparaison_chaine\n");
    	  return i;
    	}
        }
      memoire_liberer(s);
      printf("Sortie de la fonction comparaison_chaine\n");
      return -1; //il faut si c'est inférieur ou égal ajouter à la suite tout simplement
    }
     
    int
    comparer(char *s1, char *s2)
    {
      printf("Entree dans la fonction comaprer\n");
      while ((s1 && s2) != EOF) //était null vérifier si boucle infinie!!
        {
          if (*s1 == *s2) //vérifier syntaxe! chaine devrait être '*s1'?
    	{
    	  s1++;
    	  s2++;
    	  continue;
    	}
          else if (*s1 > *s2)
    	return 1;
          else
    	return -1;
        }
      return -1; // à vérifier!
    }
     
    void
    enregistrement_entree_standard(tas self, int option)
    {
      printf("Entree dans la fonction enregistrement_entree_standard\n");
      char *s=chaine_lire();
      printf("La chaine a ete lue a partir de l'entree standard, le vecteur est encore vide\n");
      if (*s == '\n')
        {
          tas_vide();
        }
      int nombre=compter_nombre_mots(s);
      printf("La fonction compter_nombre_mots a trouvee %d mots\n", nombre);
      rallonger(self, nouvelle_taille(self, nombre));
      printf("Le vecteur a ete rallonge en consequence, fonction rallonger. le placement dans vecteur debute\n");
      char *p=strchr(s, ' ');
      printf("On a cherche le premier espace dans la chaine entree\n");
      while (*s != '\0' && s != NULL /*&& p!= NULL*/)
        {
          if (p != NULL)
    	*p='\0'; 
          type_valeur=type_sommet(s);
          if (type_valeur == true)
    	{
    	  printf("Il s'agit d'un sommet entier\n");
    	  printf("On va passer en parametre a caractere_en_entier() : %s\n", s);
    	  inserer_valeur(self, pointeur_sur_entier(caractere_en_entier(s))); //était p-1 et non s
    	  printf("Un sommet entier a ete ajoute au vecteur\n");
    	}
          else
    	if ((option != 1) && (option != -2))
    	  {
    	    printf("On va passer en parametre a inserer_valeur : %s\n", s);
    	    inserer_valeur(self, s);
    	    printf("Un sommet de car a ete ajoute\n");
    	  }
          if (p != NULL)
    	p++;
          if ( p != NULL && *p == ' ')
    	{
    	  while (*p == ' ')
    	    {
    	      *p='\0'; //était '\n'
    	      p++;
    	    }
    	}
          printf("Impression de la chaine s: %s\n", s);
          if (p == NULL)
    	break;
          memoire_liberer(s);
          s=p; 
          printf("Impression de la chaine s: %s\n", s);
          p=strchr(p, ' ');
          if (p == NULL)
    	continue;
        }
      printf("L'enregistrement est terminée\n");
      int i=0;
      /*
      while (i < self->nombre_d_elements)
        {
          type_sommet(self->vecteur[i]);
          if (type_valeur == true)
    	printf("Element %d du vecteur : %d\n", i, *((int *)self->vecteur[i]));
          else
    	printf("Elements %d du vecteur : %s\n", i, (char *)self->vecteur[i]);
          i++;
        }
      */
      while (i < self->nombre_d_elements)
        {
          memoire_liberer(self->vecteur[i]);
          i++;
        }
      memoire_liberer(self);
    }
     
    void
    appliquer_ordre(int option)
    {
      printf("Debut fonction appliquer_ordre\n");
      tas tas1=faire_tas1(option);
      printf("Le tas a ete cree et les donnees entrees\n");
      tas_afficher(tas1, option);
      tas_liberer(tas1);
      printf("Sortie fonction appliquer_ordre\n");
    }
     
    static tas
    faire_tas1(int option)
    {
      tas tas1= tas_creer();
      printf("Le tas a ete cree\n");
      definir_liberation(tas1);
      printf("La liberation a ete definie\n");
      definir_affichage(tas1, selectionner_affichage);
      printf("L'affichage a ete definie\n");
      enregistrement_entree_standard(tas1, option);
      printf("L'entree standard a ete enregistree\n");
      return tas1;
    }
    dans le test-projet.c pour l'instant je ne lance que la fonction appliquer_ordre(0).

  2. #2
    Expert éminent
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Par défaut
    Citation Envoyé par garfieldkat Voir le message
    Pour l'instant je n'arrive pas à me défaire des erreurs de segmentation core dumped lors de l'exécution ^^
    Si quelqun a une idée ...
    Déjà, tu pourrais corriger tout ça :
    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
     
    Project   : Forums
    Compiler  : GNU GCC Compiler (called directly)
    Directory : C:\dev\forums\
    --------------------------------------------------------------------------------
    Switching to target: default
    Compiling: main.c
    main.c:4:21: memoire.h: No such file or directory
    main.c:5:20: chaine.h: No such file or directory
    main.c:7:20: projet.h: No such file or directory
    main.c:25: error: syntax error before "tas_creer"
    main.c:26: warning: return type defaults to `int'
    main.c: In function `tas_creer':
    main.c:28: error: `tas' undeclared (first use in this function)
    main.c:28: error: (Each undeclared identifier is reported only once
    main.c:28: error: for each function it appears in.)
    main.c:28: error: syntax error before "self"
    main.c:29: error: `self' undeclared (first use in this function)
    main.c: At top level:
    main.c:40: error: syntax error before "self"
    main.c:41: warning: function declaration isn't a prototype
    main.c: In function `definir_liberation':
    main.c:43: error: `self' undeclared (first use in this function)
    main.c:43: error: `memoire_liberer' undeclared (first use in this function)
    main.c: At top level:
    main.c:48: error: syntax error before "self"
    main.c:49: warning: function declaration isn't a prototype
    main.c: In function `tas_liberer':
    main.c:51: error: `self' undeclared (first use in this function)
    main.c:65: warning: implicit declaration of function `memoire_liberer'
    main.c: At top level:
    main.c:71: error: syntax error before "self"
    main.c:71: error: syntax error before ')' token
    main.c:75: error: syntax error before string constant
    main.c:75: warning: type defaults to `int' in declaration of `printf'
    main.c:75: warning: function declaration isn't a prototype
    main.c:75: error: conflicting types for 'printf'
    main.c:75: note: a parameter list with an ellipsis can't match an empty parameter name list declaration
    main.c:75: error: conflicting types for 'printf'
    main.c:75: note: a parameter list with an ellipsis can't match an empty parameter name list declaration
    main.c:75: warning: data definition has no type or storage class
    main.c:79: error: syntax error before "self"
    main.c:80: warning: function declaration isn't a prototype
    main.c: In function `tas_afficher':
    main.c:82: error: `self' undeclared (first use in this function)
    main.c:85: warning: implicit declaration of function `tas_iterer'
    main.c:85: error: `option' undeclared (first use in this function)
    main.c: In function `selectionner_affichage':
    main.c:97: warning: implicit declaration of function `type_sommet'
    main.c:98: warning: implicit declaration of function `afficher_entier'
    main.c:100: warning: implicit declaration of function `afficher_chaine'
    main.c: At top level:
    main.c:105: error: syntax error before "self"
    main.c:106: warning: function declaration isn't a prototype
    main.c: In function `tas_nombre_d_elements':
    main.c:108: error: `self' undeclared (first use in this function)
    main.c: At top level:
    main.c:113: error: syntax error before "self"
    main.c:113: error: `tas_iterer_jusqua_inverse' declared as function returning a function
    main.c:113: warning: function declaration isn't a prototype
    main.c:113: error: syntax error before "int"
    main.c:117: error: `self' undeclared here (not in a function)
    main.c:119: error: syntax error before "while"
    main.c:124: error: syntax error before string constant
    main.c:124: warning: type defaults to `int' in declaration of `printf'
    main.c:124: warning: function declaration isn't a prototype
    main.c:124: warning: data definition has no type or storage class
    main.c:128: error: syntax error before "self"
    main.c:128: error: `tas_iterer_jusqua' declared as function returning a function
    main.c:128: warning: function declaration isn't a prototype
    main.c:128: error: syntax error before "int"
    main.c:131: error: redefinition of 'i'
    main.c:116: error: previous definition of 'i' was here
    main.c:132: error: redefinition of 'v'
    main.c:117: error: previous definition of 'v' was here
    main.c:133: error: syntax error before "while"
    main.c:138: error: syntax error before string constant
    main.c:138: warning: type defaults to `int' in declaration of `printf'
    main.c:138: warning: function declaration isn't a prototype
    main.c:138: warning: data definition has no type or storage class
    main.c:142: error: syntax error before "self"
    main.c:142: error: `tas_iterer' declared as function returning a function
    main.c:142: warning: function declaration isn't a prototype
    main.c:142: error: syntax error before "int"
    main.c:149: error: syntax error before string constant
    main.c:149: warning: type defaults to `int' in declaration of `printf'
    main.c:149: warning: function declaration isn't a prototype
    main.c:149: warning: data definition has no type or storage class
    main.c: In function `chaine_lire':
    main.c:156: warning: implicit declaration of function `memoire_allouer'
    main.c:156: warning: initialization makes pointer from integer without a cast
    main.c:159: error: 'for' loop initial declaration used outside C99 mode
    main.c:171: warning: implicit declaration of function `memoire_reallouer'
    main.c:171: warning: assignment makes pointer from integer without a cast
    main.c: At top level:
    main.c:202: error: syntax error before "self"
    main.c:203: warning: function declaration isn't a prototype
    main.c: In function `rallonger':
    main.c:206: error: `nouvelle_taille' undeclared (first use in this function)
    main.c: At top level:
    main.c:215: error: syntax error before "self"
    main.c:216: warning: function declaration isn't a prototype
    main.c: In function `nouvelle_taille':
    main.c:219: error: `n' undeclared (first use in this function)
    Process terminated with status 1 (0 minutes, 7 seconds)
    52 errors, 31 warnings
    ca ferait le ménage...

  3. #3
    Nouveau membre du Club
    Inscrit en
    Novembre 2007
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Novembre 2007
    Messages : 5
    Par défaut
    merci, je vais éssayer. ma compilation ne m'affichait plus d'erreurs j'ai du oublier des options d'avertissement.
    En ce qui concerne memoire.h et chaine.h ce sont des bibliothèques installées sur mon pc (vus en td).

  4. #4
    Expert éminent
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Par défaut
    Citation Envoyé par garfieldkat Voir le message
    merci, je vais éssayer. ma compilation ne m'affichait plus d'erreurs j'ai du oublier des options d'avertissement.
    http://emmanuel-delahaye.developpez....tm#cfg_compilo
    En ce qui concerne memoire.h et chaine.h ce sont des bibliothèques installées sur mon pc (vus en td).
    Ben à l'évidence, elles ne sont pas installées sur le mien... On doit deviner ?

Discussions similaires

  1. extension de projet avec cloud computing
    Par hamzawhy dans le forum Langages de programmation
    Réponses: 1
    Dernier message: 03/02/2015, 16h13
  2. Qu'est ce qu'un grand projet ?
    Par Geronimo dans le forum Débats sur le développement - Le Best Of
    Réponses: 62
    Dernier message: 04/04/2013, 14h52
  3. Réponses: 0
    Dernier message: 28/11/2008, 10h19
  4. Extension pour analyser l'exécution d'un projet
    Par pilou0013 dans le forum Eclipse Java
    Réponses: 2
    Dernier message: 29/06/2006, 10h27

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