diff options
author | Haidong Ji | 2022-04-15 15:51:30 -0500 |
---|---|---|
committer | Haidong Ji | 2022-04-15 15:51:30 -0500 |
commit | 442a49ad5a48d417345959b903ae6a6d32d55759 (patch) | |
tree | c7127bb497e5e439018b1915e0136eec2c9cb124 /33_counts/counts.c~ |
Excellent fundamentals and displine training, many tools and techniques
exercises: gdb, emacs, valgrind, git
Diffstat (limited to '33_counts/counts.c~')
-rw-r--r-- | 33_counts/counts.c~ | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/33_counts/counts.c~ b/33_counts/counts.c~ new file mode 100644 index 0000000..819726a --- /dev/null +++ b/33_counts/counts.c~ @@ -0,0 +1,31 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "counts.h" +counts_t * createCounts(void) { + counts_t c = malloc(sizeof(counts_t)); + c.countArray = NULL; + c.arraySize = 0; + c.count_of_unknowns = 0; +} + +void addCount(counts_t * c, const char * name) { + if (name == NULL) { + c.count_of_unknowns++; + return; + } + + for (int i = 0; i < c.arraySize; i++) { + if (strcmp(name, c.countArray[i].string) == 0) { + c.countArray[i].count++; + return; + } + } +} +void printCounts(counts_t * c, FILE * outFile) { + //WRITE ME +} + +void freeCounts(counts_t * c) { + //WRITE ME +} |