diff --git a/chapter-3/3.4-generating-output/output.c b/chapter-3/3.4-generating-output/output.c index 993775b..aa1e9c4 100644 --- a/chapter-3/3.4-generating-output/output.c +++ b/chapter-3/3.4-generating-output/output.c @@ -1,3 +1,5 @@ +#include + #include "../3.3-building-the-data-structure-in-c/structs.c" void generate(int nwords) @@ -49,6 +51,10 @@ int main(void) for (int i = 0; i < NPREF; i++) prefix[i] = NONWORD; + long seed = time(NULL); + + srand(seed); + FILE *f = fopen("text.txt", "r"); if (f == NULL) return 1; @@ -58,4 +64,4 @@ int main(void) // printt(); generate(MAXGEN); return 0; -} \ No newline at end of file +}