If you follow the pattern
you need not worry about getting it correct.Code:thing = malloc ( N * sizeof *thing );
So thisbecomes thisCode:group_total = malloc (x * sizeof (long **));ThisCode:group_total = malloc (x * sizeof *group_total);becomes thisCode:group_total[loop] = malloc (y * sizeof (long *));pAnd thisCode:group_total[loop] = malloc (y * sizeof *group_total[loop]);becomesCode:group_total[loop][loop2] = malloc (z * sizeof (long));Then you can change **group_total to say double and have nothing to change but the declaration of group_total.Code:group_total[loop][loop2] = malloc (z * sizeof *group_total[loop][loop2]);



LinkBack URL
About LinkBacks


