/** * @file scope_lifetime_practice.cpp * @author Jeffrey Bergamini for CS 19 Boot Camp, jeffrey.bergamini@cabrillo.edu * * Some lunchtime practice! */ #include // for `std::isprint()` #include // for `std::ifstream` #include // for `std::cout` /** * `main()` can have parameters to access *command-line arguments* and *environment variables*. * * @param argc argument count: the number of command-line arguments (including the executable name) * @param argv argument values: an array of C strings containing the command-line arguments */ int main(int argc, char **argv) { // Exit with an error message if command-line arguments weren't provided: if (argc < 3) { std::cerr << "Usage: " << argv[0] << " FILE1 FILE2\n"; return 1; // nonzero exit status reports unsuccessful termination to the shell } // Attempt to open the two files specified as command-line arguments: std::ifstream f1(argv[1]); std::ifstream f2(argv[2]); if (!f1 || !f2) { std::cerr << "Cannot read from input file(s)\n"; return 2; } // TODO: Find all the unique printable characters present in one file and not the other. // Print each unique character and its ASCII encoding, one character per line, in ascending order. }