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 :

Erreur de segmentation


Sujet :

C

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Mars 2007
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2007
    Messages : 13
    Par défaut Erreur de segmentation
    Bonjour a tous,
    j'ai fais un programme et j'ai toujours une erreur de segmentation et je sais pas comment la corrigé. c'est la fonction construction_binaire qui pose problème. je pense ça vient de la variable colonne. mais je sais pas comment le corriger.
    enfaite ma fonction "codage" met des "0" dans la colonne "colonne" jusqu'à "k" et a partir de "k+1" il met des "1".
    j'utilise cette fonction dans la fonction 'construction_binaire' . elle consiste a remplir le tableau a 2 dimension. mais comme j'ai écrit j'ai toujours des erreurs de segmentation. et je vois pas du tout comment le corriger. si qq1 pourrais m'aidé a debugé ou ou moins me donné une idée. je vous remercie d'avance.
    je vous join le code :

    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
     
    #include <stdio.h>
    #include <math.h>
    #include <string.h>
    #include <sys/types.h>
    #include <unistd.h>
    #include <fcntl.h>
    #include <errno.h>
    #include <stdlib.h>
    #include<sys/stat.h>
     
    #define L 10
    #define C 10
     
     
    int cpt=0;
    int colonne = 1;
     
     
    int indice_coupure(int tableau[], int g, int d)
    {
     
      int  SommeG = 0;
      int SommeD = 0;
      int indice;
     
      while (g <= d)
        {
     
          if (SommeG < SommeD)
    	{
    	  SommeG += tableau[g];
    	  g++;          
    	}      
          else
    	{
    	  SommeD += tableau[d];
    	  d--;      
    	}     
        }       
     
      indice=g-1;
     
      return indice ;
     
     
    }
     
     
     
     
     
     
    void codage(char tab[L][C],int tab_freq[],int debut,int fin,int colonne){
     
      int k,i,j;
     
     
      k=indice_coupure(tab_freq, debut,fin);
     
     
     
      for(i=debut;i<=k;i++){
        tab[i][colonne]='0';
      }
     
      for(j=k+1;j<=fin;j++){
        tab[j][colonne]='1';
      }
      /*
        for (i=0;i<10;i++){
        for(j=0;j<10;j++){
        printf("%c",tab[i][j]);
        }
        printf ("\n");
        }
      */
     
     
     
     
    }
     
    void initialisation(char tab[L][C]){
     
      int i,j ;
     
      for(i=0;i<C;i++){
     
        for(j=0;j<L;j++){
          tab[i][j]=' ';
        }
     
      }
     
     
     
    }
     
     
    void construction_binaire(char tab[L][C], int tab_freq[],int debut,int fin,int col){
     
     
      int k,i,j;
      int debut_g,debut_d;
      int fin_g,fin_d;
     
     
     
      k=indice_coupure(tab_freq, debut,fin);
     
      debut_g=debut;
      fin_g=k;
     
      debut_d=k+1;
      fin_g=fin;
     
     
     
      if (colonne = 1){ 
        codage( tab, tab_freq, debut, fin,colonne );
     
      }
      else {
        codage( tab, tab_freq, debut_g, fin_g,colonne );
        codage( tab, tab_freq, debut_g, fin_g,colonne );
     
      }
     
      while((fin - debut )>= 1){
        construction_binaire( tab,  tab_freq, debut_g, fin_g,col+1);
        construction_binaire( tab, tab_freq,debut_d, fin_d,col+1);
      } 
     
     
     
    }
     
     
     
     
    int main (int argc, char ** argv){
      int tab_frequence[10]={1,2,3,4,5,6,7,8,9,10};
      char tab[L][C];
      int i,j;
      initialisation(tab);
      /* for(i=0;i<10;i++){
         
      for(j=0;j<10;j++){
      printf("%c", tab[i][j]=' ');
      }
      printf("\n");
      }
      printf("\n");*/
     
      //codage(tab, tab_frequence,0,9,2);
      //codage(tab, tab_frequence,5,9,3);
     
      construction_binaire( tab, tab_frequence,0,9,colonne);
     
     
      return (EXIT_SUCCESS);
     
    }

  2. #2
    Membre Expert Avatar de nicolas.sitbon
    Profil pro
    Inscrit en
    Août 2007
    Messages
    2 015
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Août 2007
    Messages : 2 015
    Par défaut
    J'ai fais un peu de ménage dans ton code, sans le corriger, juste histoire d'y voir plus clair :
    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
    #include <stdio.h>
     
    #define L 10
    #define C 10
     
    int cpt = 0;
    int colonne = 1;
     
    int indice_coupure (int *tableau, int g, int d);
    void codage (char tab[][C],int *tab_freq,int debut, int fin, int col);
    void initialisation (char tab[][C]);
    void construction_binaire (char tab[][C], int *tab_freq ,int debut, int fin,
                               int col);
     
    int main (void)
    {
       int tab_frequence[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
       char tab[L][C];
     
       initialisation (tab); 
       construction_binaire (tab, tab_frequence, 0, 9, colonne);
     
       return 0; 
    }
     
    int indice_coupure (int *tableau, int g, int d)
    {
       int SommeG = 0;
       int SommeD = 0;
       int indice;
     
       while (g <= d)
       { 
          if (SommeG < SommeD)
          {
             SommeG += tableau[g];
             g++;          
          }      
          else
          {
             SommeD += tableau[d];
             d--;      
          }     
       }       
     
      indice = g - 1;
     
      return indice;
    } 
     
    void codage (char tab[][C],int *tab_freq,int debut, int fin, int col)
    {
       int k, i, j;
     
       k = indice_coupure (tab_freq, debut,fin);
     
       for (i = debut; i <= k; i++)
       {
          tab[i][col] = '0';
       }
     
       for(j = k + 1; j <= fin; j++)
       {
          tab[j][col] = '1';
       }
    }
     
    void initialisation (char tab[][C])
    {
       int i;
     
       for (i = 0; i < C; i++)
       {
          int j;
     
          for (j = 0; j < L; j++)
          {
             tab[i][j] = ' ';
          }
       }
    }
     
    void construction_binaire (char tab[][C], int *tab_freq , int debut, int fin,
                               int col)
    {
       int k;
       int debut_g, debut_d;
       int fin_g, fin_d;
     
       k = indice_coupure (tab_freq, debut, fin);
       debut_g = debut;
       fin_g = k;
       debut_d = k + 1;
       fin_g = fin;
     
       if (colonne == 1)
       { 
          codage (tab, tab_freq, debut, fin, colonne);
       }
       else 
       {
          codage (tab, tab_freq, debut_g, fin_g, colonne);
          codage (tab, tab_freq, debut_g, fin_g, colonne);
       }
     
       while ((fin - debut ) >= 1)
       {
          construction_binaire (tab, tab_freq, debut_g, fin_g, col+1);
          construction_binaire (tab, tab_freq, debut_d, fin_d, col+1);
       } 
    }
    bilan du compilateur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    main.c:109: attention : «fin_d" is used uninitialized in this function
    Commence par corriger ça déjà.

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Mars 2007
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2007
    Messages : 13
    Par défaut
    Merci beaucoup pour ta reponse. c'est a cause des copier/colé j'ai plu sd'erreur de segmentation. Mais je croi que j'ai une boucle infinie car mon programme ne ce termine jamais. si qq1 pourais m'aider car je m'en sort pas. je vous remercie d'avance pour votre reponse

  4. #4
    Expert confirmé

    Inscrit en
    Août 2006
    Messages
    3 967
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 3 967
    Par défaut
    Gie,

    Dans la fonction
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    void construction_binaire (char tab[][C], int *tab_freq , int debut, int fin,
                               int col)
    rien ne met à jour les valeurs de debut et fin, ce qui fait que la boucle
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
       while ((fin - debut ) >= 1)
       {
          construction_binaire (tab, tab_freq, debut_g, fin_g, col+1);
          construction_binaire (tab, tab_freq, debut_d, fin_d, col+1);
       }
    est infinie.

  5. #5
    Membre éclairé
    Profil pro
    Inscrit en
    Décembre 2007
    Messages
    613
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2007
    Messages : 613
    Par défaut
    Le problème des variables debut et fin est qu'elles sont passés par valeur dans la fonction construction_binaire, et donc elles ne peuvent pas être modifiés.
    Il faudrait les passer par adresse.

  6. #6
    Expert confirmé

    Inscrit en
    Août 2006
    Messages
    3 967
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 3 967
    Par défaut
    Fai,
    Citation Envoyé par pasdeface Voir le message
    Le problème des variables debut et fin est qu'elles sont passés par valeur dans la fonction construction_binaire, et donc elles ne peuvent pas être modifiés.
    Il faudrait les passer par adresse.
    De toute manière, il n'y a aucune instruction pour les modifier. Donc, passage par valeur ou adresse dans l'état du code ne change rien.

    Il faut changer le passage en le mettant par adresse, ET s'occuper de changer les valeurs.

  7. #7
    Membre averti
    Profil pro
    Inscrit en
    Mars 2007
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2007
    Messages : 13
    Par défaut
    merci pour vos reponses.
    comme j'arivais pas a regler le probleme j'ai essayé de le faire d'une autre facon.j'ai plus d'erreur de segmentation mais il fais qu'une fois la boucle. je sais pas pour quoi. je vais essayé de chercher mais je sais pas si je vais reusir.
    je join le nouveau programme. si qq1 pourais m'aider SVP car c'est le dernier jour pour finir cette fonction. je vous remercie d'avance

    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
     
     
    #include <stdio.h>
    #include <math.h>
    #include <string.h>
    #include <sys/types.h>
    #include <unistd.h>
    #include <fcntl.h>
    #include <errno.h>
    #include <stdlib.h>
    #include<sys/stat.h>
     
    #define L 10
    #define C 10
     
     
    int cpt=0;
     
     
    void trier_croissant(int tab[]);
    int indice_coupure(int tableau[], int g, int d);
    void codage(char tab[L][C],int tab_freq[],int debut,int fin,int colonne);
    void initialisation(char tab[L][C]);
    void construction_binaire(char tab[L][C], int tab_freq[],int debut,int fin);
     
     
    void trier_croissant(int tab[]){
      int i,j;
      int min;
      int temp;
     
     
     
      for(i=0; i<10 ; i++){
     
        for(j=i;j<10; j++){
          min=tab[i];
     
          if(tab[j]<min){
    	min=tab[j];
           	temp=tab[i];
            tab[i]=min;
    	tab[j] = temp;
     
     
          }
        }
     
     
      }
    }
     
     
     
     
    int indice_coupure(int tableau[], int g, int d)
    {
     
      int  SommeG = 0;
      int SommeD = 0;
      int indice;
     
      while (g <= d)
        {
     
          if (SommeG < SommeD)
    	{
    	  SommeG += tableau[g];
    	  g++;          
    	}      
          else
    	{
    	  SommeD += tableau[d];
    	  d--;      
    	}     
        }       
     
      indice=g-1;
     
      return indice ;
     
     
    }
     
     
     
     
     
     
    void codage(char tab[L][C],int tab_freq[],int debut,int fin,int colonne){
     
      int k,i,j;
     
     
      k=indice_coupure(tab_freq, debut,fin);
     
     
     
      for(i=debut;i<=k;i++){
        tab[i][colonne]='0';
      }
     
      for(j=k+1;j<=fin;j++){
        tab[j][colonne]='1';
      }
      /*
        for (i=0;i<10;i++){
        for(j=0;j<10;j++){
        printf("%c",tab[i][j]);
        }
        printf ("\n");
        }
      */
     
     
     
     
    }
     
    void initialisation(char tab[L][C]){
     
      int i,j ;
     
      for(i=0;i<C;i++){
     
        for(j=0;j<L;j++){
          tab[i][j]=' ';
        }
     
      }
     
    }
     
     
    void construction_binaire(char tab[L][C], int tab_freq[],int debut,int fin){
     
     
      int k,i,j;
     
     
      int tab_k[C];
      int nb_element=1;
     
     
      tab_k[0]=debut;
      tab_k[1]=fin;
     
      for (i=1;i<10;i++){
        for(j=0;j<nb_element;j++){
          if((tab_k [j+1] - tab_k[j]) >= 1){
    	codage( tab,tab_freq, tab_k[j],tab_k[j+1],i);
    	nb_element++;
            k=indice_coupure(tab_freq, tab_k[j],tab_k[j+1]);
    	tab_k[nb_element]=k;
    	trier_croissant(tab_k);
          }
        }
      }
     
    }
     
     
     
     
    int main (int argc, char ** argv){
      int tab_frequence[10]={1,2,3,4,5,6,7,8,9,10};
      char tab[L][C];
     
      initialisation(tab);
     
     
      construction_binaire( tab, tab_frequence,0,9);
     
     
     
      return (EXIT_SUCCESS);
     
    }

  8. #8
    Membre Expert Avatar de nicolas.sitbon
    Profil pro
    Inscrit en
    Août 2007
    Messages
    2 015
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Août 2007
    Messages : 2 015
    Par défaut
    dans main() tu fais :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    construction_binaire (tab, tab_frequence, 0, 9);
    dans construction_binaire() tu fais :
    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
    int nb_element = 1;
    
       tab_k[0] = debut;
       tab_k[1] = fin;
    
       for (i = 1; i < 10; i++)
       {
          for (j = 0; j < nb_element; j++)
          {
             if ((tab_k[j + 1] - tab_k[j]) >= 1)
             {
                codage (tab, tab_freq, tab_k[j], tab_k[j + 1], i);
                nb_element++;
                k = indice_coupure (tab_freq, tab_k[j], tab_k[j + 1]);
                tab_k[nb_element] = k;
                trier_croissant (tab_k);
             }
          }
       }
    on voit que dans tab_k, tu n'as initialisé que les 2 premiers éléments

    enfin, dans trier_croissant() :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    for (j = i; j < 10; j++)
          {
             min = tab[i];
    
             if (tab[j] < min)
             {
                min = tab[j];
                temp = tab[i];
                tab[i] = min;
                tab[j] = temp;
    
             }
          }
    et la tu testes une valeur non initialisé (quand j == 2), ça ne pardonne pas!!!

  9. #9
    Membre averti
    Profil pro
    Inscrit en
    Mars 2007
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2007
    Messages : 13
    Par défaut
    Merci pour ta reponse.
    j'ai encor modifier le code mais j'obtien toujour pas ce que je veut je join le code et le resultat.



    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
     
     
    #include <stdio.h>
    #include <math.h>
    #include <string.h>
    #include <sys/types.h>
    #include <unistd.h>
    #include <fcntl.h>
    #include <errno.h>
    #include <stdlib.h>
    #include<sys/stat.h>
     
    #define L 10
    #define C 10
     
     
    int cpt=0;
     
     
    void trier_croissant(int tab[],int taille);
    int indice_coupure(int tableau[], int g, int d);
    void codage(char tab[L][C],int tab_freq[],int debut,int fin,int colonne);
    void initialisation(char tab[L][C]);
    void construction_binaire(char tab[L][C], int tab_freq[],int debut,int fin);
     
     
    void trier_croissant(int tab[],int taille){
      int i,j;
      int min;
      int temp;
     
     
     
      for(i=0; i<taille ; i++){
     
        for(j=i;j<taille; j++){
          min=tab[i];
     
          if(tab[j]<min){
    	min=tab[j];
           	temp=tab[i];
            tab[i]=min;
    	tab[j] = temp;
     
     
          }
        }
     
     
      }
    }
     
     
     
     
    int indice_coupure(int tableau[], int g, int d)
    {
     
      int  SommeG = 0;
      int SommeD = 0;
      int indice;
     
      while (g <= d)
        {
     
          if (SommeG < SommeD)
    	{
    	  SommeG += tableau[g];
    	  g++;          
    	}      
          else
    	{
    	  SommeD += tableau[d];
    	  d--;      
    	}     
        }       
     
      indice=g-1;
     
      return indice ;
     
     
    }
     
     
     
     
     
     
    void codage(char tab[L][C],int tab_freq[],int debut,int fin,int colonne){
     
      int k,i,j;
     
     
      k=indice_coupure(tab_freq, debut,fin);
     
     
     
      for(i=debut;i<=k;i++){
        tab[i][colonne]='0';
      }
     
      for(j=k+1;j<=fin;j++){
        tab[j][colonne]='1';
      }
      /*
        for (i=0;i<10;i++){
        for(j=0;j<10;j++){
        printf("%c",tab[i][j]);
        }
        printf ("\n");
        }
      */
     
     
     
     
    }
     
    void initialisation(char tab[L][C]){
     
      int i,j ;
     
      for(i=0;i<C;i++){
     
        for(j=0;j<L;j++){
          tab[i][j]=' ';
        }
     
      }
     
    }
     
     
    void construction_binaire(char tab[L][C], int tab_freq[],int debut,int fin){
     
     
      int k,i,j;
     
     
      int tab_k[C];
      int nb_element=1;
     
     
      tab_k[0]=debut;
      tab_k[1]=fin;
     
      for (i=1;i<10;i++){
        for(j=0;j<nb_element;j++){
          if((tab_k [j+1] - tab_k[j]) >= 1){
    	codage( tab,tab_freq, tab_k[j],tab_k[j+1],i);
            k=indice_coupure(tab_freq, tab_k[j],tab_k[j+1]);
    	tab_k[nb_element+1]=k;
     
          }
     
           }
         	nb_element++;	trier_croissant(tab_k,nb_element+2);
     
      }
     
    }
     
     
     
     
    int main (int argc, char ** argv){
      int tab_frequence[10]={1,2,3,4,5,6,7,8,9,10};
      char tab[L][C];
      int i,j;
     
      initialisation(tab);
     
     
      construction_binaire( tab, tab_frequence,0,9);
     
         for(i=0;i<10;i++){
     
      for(j=0;j<10;j++){
      printf("%c", tab[i][j]);
      }
      printf("\n");
      }
      printf("\n");
     
      return (EXIT_SUCCESS);
     
    }

    resultat:
    ce que je devrais obtenir (il n'y a as d'espace je l'ai mis pour que ce soit plus lisible):

    0 0 0 0 0
    0 0 0 0 1
    0 0 0 1
    0 0 1 0
    0 0 1 1
    0 1 0
    0 1 1
    1 0 0
    1 0 1
    1 1

    mais voila ce que j'obtient :
    000000000
    000000001
    00011111
    001
    001
    01
    01
    1
    1
    1

Discussions similaires

  1. Erreurs de segmentation !
    Par anti-conformiste dans le forum Applications et environnements graphiques
    Réponses: 16
    Dernier message: 18/10/2005, 11h11
  2. Erreur de segmentation
    Par Trunks dans le forum C
    Réponses: 3
    Dernier message: 06/10/2005, 18h28
  3. Erreur de segmentation (Inconnue)
    Par Dark-Meteor dans le forum C
    Réponses: 5
    Dernier message: 08/09/2005, 13h42
  4. [Dev-C++] Erreur de segmentation...
    Par sas dans le forum Dev-C++
    Réponses: 11
    Dernier message: 26/03/2005, 14h25
  5. erreur de segmentation
    Par transistor49 dans le forum C++
    Réponses: 10
    Dernier message: 15/03/2005, 11h18

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