Sha256: fa285cf9ced57fb213c4022b39f019f860c7e2b7473e49bf23bccc3281f7ac6c

Contents?: true

Size: 931 Bytes

Versions: 101

Compression:

Stored size: 931 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];
   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

101 entries across 101 versions & 1 rubygems

Version Path
trackler-2.2.1.80 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.79 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.78 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.77 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.76 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.75 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.74 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.73 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.72 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.71 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.70 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.69 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.68 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.67 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.66 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.65 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.64 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.63 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.62 tracks/c/exercises/word-count/src/word_count.h
trackler-2.2.1.61 tracks/c/exercises/word-count/src/word_count.h