This assignment involves writing a C++ program to identify and count lines, words, and characters. For the purpose of this assignment, we define a “word” as a sequence of characters that are not whitespace characters. Words are delimited by one or more whitespace characters.
A whitespace character, such as a space, tab, or newline, is any character for which the <cctype> function isspace() returns a value of true.
The operation of your program is controlled by the command line arguments that are passed to your program. Command line arguments consist of an optional set of flags arguments (a flag argument is an argument whose first character is a dash), followed by an optional list of filenames.
If no filenames are specified, the program should read from standard input. For each file specified (or, in the case of no file names specified, the standard input), the program must read the entire input and produce a count of characters, lines, and words. The output should be printed, one line per file, as follows:
Lines words characters filename
The numerical output (lines, words, characters) should be printed right justified in columns that are 12 characters wide. The filename should be printed left justified in the fourth column. In the case where the program in reading standard input, no filename should be printed.
The thing im really confused about is that I never used argv or argc together with a file.That is why im so confused.