lecture_materials:week_00
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lecture_materials:week_00 [2025-08-18 22:07] – Jeffrey Bergamini | lecture_materials:week_00 [2025-08-22 12:59] (current) – Jeffrey Bergamini | ||
|---|---|---|---|
| Line 119: | Line 119: | ||
| === raii.cpp (illustrating the concept of RAII) === | === raii.cpp (illustrating the concept of RAII) === | ||
| - | <file cpp scopes_annotated.cpp [enable_line_numbers=true]> | + | <file cpp raii.cpp [enable_line_numbers=true]> | 
| /** | /** | ||
| * @file raii.cpp | * @file raii.cpp | ||
| Line 163: | Line 163: | ||
|   std:: |   std:: | ||
|   std::cout << " |   std::cout << " | ||
| - | // std::cout is just a plain input stream: | + | // std::cin is just a plain input stream: | 
|   std::cout << " |   std::cout << " | ||
| // Lifetimes of `hamlet` and `othello` end here. | // Lifetimes of `hamlet` and `othello` end here. | ||
| Line 186: | Line 186: | ||
| */ | */ | ||
| - | #include < | + | #include < | 
| - | #include < | + | #include < | 
| - | #include < | + | #include < | 
| + | /** | ||
| + | * `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) { | int main(int argc, char **argv) { | ||
| + |   // Exit with an error message if command-line arguments weren' | ||
| + | if (argc < 3) { | ||
| + |     std::cerr << " | ||
| + | return 1; // nonzero exit status reports unsuccessful termination to the shell | ||
| + | } | ||
| + | // Attempt to open the two files specified as command-line arguments: | ||
|   std:: |   std:: | ||
|   std:: |   std:: | ||
| - |   // TODO: Find all the printable characters  | + |    | 
| - | // Print each unique character and its ASCII number, one character per line, in ascending order. | + |     std::cerr << " | 
| + | return 2; | ||
| + | } | ||
| + |    | ||
| + | // Print each unique character and its ASCII encoding, one character per line, in ascending order. | ||
| } | } | ||
| </ | </ | ||
| Line 272: | Line 288: | ||
| ===== Wednesday ===== | ===== Wednesday ===== | ||
| - | TBD | + | {{ : | 
| ===== Thursday ===== | ===== Thursday ===== | ||
| - | TBD | + | {{ : | 
| + | & Programming Languages Guide}} | ||
| ===== Friday ===== | ===== Friday ===== | ||
| - | TBD | + | {{ : | 
lecture_materials/week_00.1755580024.txt.gz · Last modified:  by Jeffrey Bergamini
                
                