/* CSPP 50101 * Lab 10 - ga_count.c */ #include #include #include "garray.h" int main() { GArray * ga; int i,n; ga = init(10); while( scanf("%d",&n) != EOF) { /* ga stores count of number of occurrences of n */ if(increment(ga,n)==GA_ERR) { printf("Error in call to increment()\n"); dispose(ga); exit(-1); } } /* Display non-zero counts */ for(i=0;i0) printf("%d: %d\n",i,count); } dispose(ga); return 0; }