Sha256: bad1299a033c67fc0efd7e691dbd16e89e7b5c72234e39a34fbb5c35db985372

Contents?: true

Size: 986 Bytes

Versions: 18

Compression:

Stored size: 986 Bytes

Contents

#ifndef WORD_COUNT_H
#define WORD_COUNT_H

#define MAX_WORDS 20            // at most MAX_WORDS can be found in the test input string
#define MAX_WORD_LENGTH 50      // no individual word can exceed this length

// results structure
typedef struct word_count_word {
   char text[MAX_WORD_LENGTH + 1];      // allow for the string to be null-terminated
   int count;
} word_count_word_t;

#define EXCESSIVE_LENGTH_WORD     -1
#define EXCESSIVE_NUMBER_OF_WORDS -2

// word_count - routine to classify the unique words and their frequency in a test input string
// inputs:
//    input_text =  a null-terminated string containing that is analyzed
//
// outputs:
//    words = allocated structure to record the words found and their frequency
//    uniqueWords - number of words in the words structure
//           returns a negative number if an error.
//           words will contain the results up to that point.
int word_count(const char *input_text, word_count_word_t * words);

#endif

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.179 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.178 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.177 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.176 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.175 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.174 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.173 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.172 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.171 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.170 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.169 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.167 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.166 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.165 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.164 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.163 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.162 tracks/c/exercises/word-count/src/word_count.h