Hi
When I compile the program, the compiler return a warning message: "Call to function 'printStatistics' with no prototype"
Can someone told me how can I correct it? thk a lot
Code:#include <stdio.h> #include <stdlib.h> #include <time.h> #define TESTSET 1000000 int counter[3]; /* to hold the occurence of 0, 1, and 2 */ void printStatistics() { int i; printf("Value Frequency\n"); for (i=0; i<3; i++) { printf("%d %d\n", i, counter[i]); } } void generateStatistics(int number) { int i; int random; srand(time(NULL)); /* set a new random seed */ for (i=0; i<number; i++) { random = rand() % 3; /* generate 0, 1, or 2 */ counter[random]++; } } void main() { generateStatistics(TESTSET); printf("Frequencies of 0, 1, and 2 in %d values\n", TESTSET); printStatistics(); getchar(); }



LinkBack URL
About LinkBacks


