Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 0.56 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. typedef char Filme[60];
  2.  
  3. typedef struct sLBilhete{
  4.         int lugar;
  5.         struct sLBilhete *seg;
  6. } *LBilhete, NLBilhete;
  7.  
  8. typedef struct sSala{
  9.         int nlugares;
  10.         LBilhete vendidos;
  11.         Filme filme;
  12. } Sala;
  13.  
  14. typedef struct sCinema{
  15.         Sala s;
  16.         struct sCinema *seg;
  17. } *Cinema, NCinema;
  18.  
  19. Cinema inserirSala(Cinema c, Sala sala){
  20.         Cinema new;
  21.         new = (Cinema)malloc(sizeof(NCinema));
  22.         if(new==NULL) return NULL;
  23.         new->s=sala;
  24.         new->seg=c;
  25.         return new;
  26. }
  27.  
  28.  
  29. void listar( Cinema c ){
  30.         while(c){
  31.                 printf("Filme em exibição:%s\n",c->s.filme);
  32.                 c=(c->seg);
  33.         }
  34. }