Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. void leiakeskmine(film **filmid, arvustus **arvustused ,int *filmidearv ,int *arvustustearv)
  2. {
  3. int i, j;
  4. int ajutarvnum;
  5.  
  6. for(i=0; i<*filmidearv; i++)
  7. {
  8. (*filmid+i)->hindedlistis = malloc(1*sizeof(int));
  9. (*filmid+i)->hindedlistispointer = 0;
  10. }
  11.  
  12. for(i=0; i< *arvustustearv ;i++)
  13. {
  14. for(j=0;j<*filmidearv; j++)
  15. {
  16. if( (*filmid+j)->fkood == (*arvustused+i)->fkood)
  17. {
  18. ajutarvnum = (int)realloc((*filmid+j)->hindedlistis, ((((*filmid+j)->hindedlistispointer) * sizeof(int))+1) );
  19. (*filmid+j)->hindedlistis = &ajutarvnum;
  20. (*filmid+j)->hindedlistis[(*filmid+j)->hindedlistispointer] = (*arvustused)->ID;
  21. (*filmid+j)->hindedlistispointer = (*filmid+j)->hindedlistispointer+1;
  22. printf("piiks!!\n");
  23. }
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement