bunch of C programming concepts
/**
* Counts number of words, separated by spaces, in a line.
* @param line string in which to count words
* @param start_idx starting index to search for words (>= 0)
* @return number of words in the line
*/
int word_count(ref string line, int start_idx);