Johnny Digital Posted November 27, 2006 at 12:03 AM Report #66970 Posted November 27, 2006 at 12:03 AM Boas, 'Tou a ter aki um dakeles problemas chatos e q n percebo a razão pq n consigo fazer este pedacito de codigo funcionar. Tou a usar o gcc em cygwin (gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)) um pedaço de codigo problematico é este: typedef struct STRUCT_NODE_RAIZ { struct RAIZ_NODE *prox; struct BUCKET *filho; } RAIZ_NODE; typedef struct STRUCT_RAIZ_BUCKET { int n; struct RAIZ_NODE *data; } RAIZ_BUCKET; int inserir (RAIZ_BUCKET* raiz) { RAIZ_NODE *rn; rn=(RAIZ_NODE*)malloc (sizeof(RAIZ_NODE)); raiz->data=rn; return 0; } o output do gcc: argh.c: In function `inserir': argh.c:20: warning: assignment from incompatible pointer type Alguem me pode dar uma dica? estive a ver nos manuais e estou a fazer tudo como lá é dito (ou tou a ficar cegueta???) cumps
Rui Carlos Posted November 27, 2006 at 12:08 AM Report #66973 Posted November 27, 2006 at 12:08 AM podias usar o GeSHi, não? assim à primeira vista diria que tens aqui um erro... typedef struct STRUCT_NODE_RAIZ { struct RAIZ_NODE *prox; // não devia ser 'struct STRUCT_NODE_RAIZ' ? struct BUCKET *filho; } RAIZ_NODE; typedef struct STRUCT_RAIZ_BUCKET { int n; struct RAIZ_NODE *data; // penso que o 'struct' está a mais } RAIZ_BUCKET; Rui Carlos Gonçalves
Johnny Digital Posted November 27, 2006 at 12:10 AM Author Report #66976 Posted November 27, 2006 at 12:10 AM aumm.. eu tb achei estranho esses structs todos..lol obrigadao 😛 parece q só se usa quando é um "link" para o mesmo struct... OBRIGADO 👍 vou ver do geshi.. n conheço 😄 podias usar o GeSHi, não? assim à primeira vista diria que tens aqui um erro... typedef struct STRUCT_NODE_RAIZ { struct RAIZ_NODE *prox; struct BUCKET *filho; } RAIZ_NODE; typedef struct STRUCT_RAIZ_BUCKET { int n; struct RAIZ_NODE *data; // penso que o 'struct' está a mais } RAIZ_BUCKET;
Rui Carlos Posted November 27, 2006 at 12:14 AM Report #66979 Posted November 27, 2006 at 12:14 AM fiz uma correcção no outro post... vou ver do geshi.. n conheço 👍 o GeSHi permite-te colocar código aqui no fórum com cores, tal como o que eu coloquei. para isso usas as tags [ code=c ] e [ /code ] (sem espaços) Rui Carlos Gonçalves
Johnny Digital Posted November 27, 2006 at 12:22 AM Author Report #66983 Posted November 27, 2006 at 12:22 AM em relação à outra correção... tens razão... bolas tou todo confundido... se te disser q estou a implementar uma b+ e a fazer erros destes chamas-me maluco 👍 obrigado 😛
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now