CC_D.offsets = (long *)calloc(CC_D.num_cards + 1, sizeof (long)); CH_D.offsets = (long *)calloc(CH_D.num_cards + 1, sizeof (long));
CC_D.offsets = (int32_t *)calloc(CC_D.num_cards + 1, sizeof (int32_t)); CH_D.offsets = (int32_t *)calloc(CH_D.num_cards + 1, sizeof (int32_t));
main(ac, av)int	ac;char	*av[]; {	getargs(ac, av);	if ((inf = fopen(infile, "r")) == NULL) {		perror(infile);		exit(1);	}	count();	/*	 * allocate space for pointers.	 */	CC_D.offsets = (long *)calloc(CC_D.num_cards + 1, sizeof (long));	CH_D.offsets = (long *)calloc(CH_D.num_cards + 1, sizeof (long));	fseek(inf, 0L, 0);	if ((outf = fopen(outfile, "w")) == NULL) {		perror(outfile);		exit(0);	}	fwrite(deck, sizeof (DECK), 2, outf);	fwrite(CC_D.offsets, sizeof (long), CC_D.num_cards, outf);	fwrite(CH_D.offsets, sizeof (long), CH_D.num_cards, outf);	putem();	fclose(inf);	fseek(outf, 0, 0L);	fwrite(deck, sizeof (DECK), 2, outf);	fwrite(CC_D.offsets, sizeof (long), CC_D.num_cards, outf);	fwrite(CH_D.offsets, sizeof (long), CH_D.num_cards, outf);	fclose(outf);	printf("There were %d com. chest and %d chance cards\n", CC_D.num_cards, CH_D.num_cards);	exit(0);}