Regarding the Unix command “wc” what is considered as a word?
问题 The command wc provides lineCount , wordCount , and charCount . I am writing a program that simulates the wc command as it takes a file and spits out the 3 properties. Line count is easy because if it sees \n it will ++lineCount and if a char exists and it's not EOF, it will ++charCount . But what does word mean? What separates words, whitespace? 回答1: This is specified by POSIX: The wc utility shall consider a word to be a non-zero-length string of characters delimited by white space. The man