Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void leiakeskmine(film **filmid, arvustus **arvustused ,int *filmidearv ,int *arvustustearv)
- {
- int i, j;
- int ajutarvnum;
- for(i=0; i<*filmidearv; i++)
- {
- (*filmid+i)->hindedlistis = malloc(1*sizeof(int));
- (*filmid+i)->hindedlistispointer = 0;
- }
- for(i=0; i< *arvustustearv ;i++)
- {
- for(j=0;j<*filmidearv; j++)
- {
- if( (*filmid+j)->fkood == (*arvustused+i)->fkood)
- {
- ajutarvnum = (int)realloc((*filmid+j)->hindedlistis, ((((*filmid+j)->hindedlistispointer) * sizeof(int))+1) );
- (*filmid+j)->hindedlistis = &ajutarvnum;
- (*filmid+j)->hindedlistis[(*filmid+j)->hindedlistispointer] = (*arvustused)->ID;
- (*filmid+j)->hindedlistispointer = (*filmid+j)->hindedlistispointer+1;
- printf("piiks!!\n");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement