Oppure

Loading
12/02/13 13:48
djleo
salve ho un problema con la compilazione di un programma.
Vi posto il codice dove mi da gli errori:
typedef struct _poslist{ // un nodo (lista di posizioni)
        int position;
        struct _poslist *next;
      } Poslist;

typedef Poslist **Encoded_string; // array di teste di lista

// i nodi di tutte le liste
static Poslist nodi[] = {
  {5, &nodi[1]},                // .    0
  {11, NULL},                   // .    1
  {2, NULL},                    // A    2
  {0, &nodi[4]},                // E    3
  {4, NULL},                    // E    4
  {13, NULL},                   // K    5
  {3, NULL},                    // M    6
  {10, &nodi[8]},               // O    7
  {12, NULL},                   // O    8
  {1, NULL},                    // S    9
  {6, &nodi[11]},               // T    10
  {8, &nodi[12]},               // T    11
  {9, NULL},                    // T    12
  {7, NULL}                    // U    13
};


Encoded_string  teststring = {
  &nodi[2],                     // A    1
  NULL,                         // B    2
  NULL,                         // C    3
  NULL,                         // D    4
  &nodi[3],                     // E    5
  NULL,                         // F    6
  NULL,                         // G    7
  NULL,                         // H    8
  NULL,                         // I    9
  NULL,                         // J    10
  &nodi[5],                     // K    11
  NULL,                         // L    12
  &nodi[6],                     // M    13
  NULL,                         // N    14
  &nodi[7],                     // O    15
  NULL,                         // P    16
  NULL,                         // Q    17
  NULL,                         // R    18
  &nodi[9],                     // S    19
  &nodi[10],                    // T    20
  &nodi[13],                    // U    21
  NULL,                         // V    22
  NULL,                         // W    23
  NULL,                         // X    24
  NULL,                         // Y    25
  NULL,                         // Z    26
};


errori:
warning: initialization from incompatible pointer type|

mi da questo errore su tutta l'inizializzazione di teststring
aaa
12/02/13 15:48
pierotofy
typedef Poslist *Encoded_string; // array di teste di lista


Invece di:

typedef Poslist **Encoded_string; // array di teste di lista


?
Il mio blog: piero.dev