[Prévia] [Próxima] [Prévia por assunto] [Próxima por assunto]
[Índice cronológico] [Índice de assunto]

RE: Estrutura e ponteiros



Leonardo Giantini Trabuco wrote (on Friday, 7 Jun 2002, at 13:56:14 -0300):
 > [...]
 > -----------------------------------------------------------------------
 > 
 > int ITEMscan(Item *x) 
 >   { int t;
 >     *x.word = &buf[cnt]; 
 >     t = scanf("%s", *x.word); cnt += strlen(*x.word)+1;
 >     *x.rep = 0;
 >     return t;
 >   }  
 > 
 > -----------------------------------------------------------------------
 > 
 > Mas obtenho o seguinte erro na compilação:
 > 
 > <1micro04:~/C/Lista1/Ex18/novo> $ gcc Item.c ST.c driver.c 
 > Item.c:12: invalid initializer
 > Item.c: In function `ITEMscan':
 > Item.c:16: request for member `word' in something not a structure or union
 > Item.c:17: request for member `word' in something not a structure or union
 > Item.c:17: request for member `word' in something not a structure or union
 > Item.c:18: request for member `rep' in something not a structure or union

  *x.word 

significa 

  (*x).word

ou

  *(x.word)

?

 > Não entendo....... :-)
 > Leo.