Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
542
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. > base.c:38:19: error: dereferencing ‘void *’ pointer [-Werror]
  2. >
  3. if(a.ra < (*p)->info.ra)
  4. > ^
  5. > base.c:38:19: error: request for member ‘info’ in something not a structure or union
  6. >
  7. > base.c:39:16: error: dereferencing ‘void *’ pointer [-Werror]
  8. >
  9. *p = (*p)->esq;
  10. >
  11. > ^
  12.  
  13. Boolean InsertBase(Base *p, Student a) {
  14. while((*p) != NULL){
  15. if(a.ra < (*p)->info.ra)
  16. *p = (*p)->left;
  17. else if(a.ra > (*p)->info.ra)
  18. *p = (*p)->right;
  19. else
  20. return false;
  21. }
  22.  
  23. *p = MALLOC(sizeof(NoArv));
  24. (*p)->info = MALLOC(sizeof(Student));
  25. (*p)->info.ra = a.ra;
  26. (*p)->info.name = a.name;
  27.  
  28. (*p)->left = (*p)->right = NULL;
  29.  
  30. return true;
  31.  
  32. }
  33.  
  34. typedef void * Base;
  35. typedef char * String;
  36. typedef enum {false, true} Boolean;
  37.  
  38. typedef struct {
  39. int ra;
  40. String name;
  41. } Student;
  42.  
  43. typedef struct AuxNoArv {
  44. Student info;
  45. struct AuxNoArv *left,*right;
  46. } NoArv, * ImplBase;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement