diff options
Diffstat (limited to 'comp/lucas-standen-NEA/code2/parser.c')
-rw-r--r-- | comp/lucas-standen-NEA/code2/parser.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/comp/lucas-standen-NEA/code2/parser.c b/comp/lucas-standen-NEA/code2/parser.c index 7d177ca..62f32fa 100644 --- a/comp/lucas-standen-NEA/code2/parser.c +++ b/comp/lucas-standen-NEA/code2/parser.c @@ -10,7 +10,8 @@ typedef struct strings { int count; } strings; -int countChars(char *s, char c){ // counts the number of times c ocurrs in s +//# counts the number of times c ocurrs in s +int countChars(char *s, char c){ int count = 0; for (int i = 0; i < strlen(s); i++){ if (s[i] == c) count++; @@ -18,6 +19,7 @@ int countChars(char *s, char c){ // counts the number of times c ocurrs in s return count; } +//# returns an array of strings (type strings) of the file contents, split by line strings *parse(FILE *f){ strings *strs = malloc(sizeof(strings)); strs->strs = malloc(sizeof(char **)); |