-
Course
- Core Tech
C++ Foundations: File I/O and Exception Handling
Many applications need to use files to store and read data. This course will teach you the basics of using files in C++, including file I/O, and how to handle error conditions.
What you'll learn
Many applications need to use files for storing data and reading it back. These may be simple configuration files or more complex pieces of structured data. In this course, C++ Foundations: File I/O and Exception Handling, you’ll learn how to implement basic input/output operations with files in C++. First, you’ll see how to open a file, how to read and write data, and how to handle error conditions. Then, you’ll explore formatted output using std::format and std::print. Finally, you’ll learn how to handle error conditions using exceptions or other approaches like std::expected. When you’re finished with this course, you’ll have the skill and knowledge needed to implement file I/O operations and handle error conditions in your own C++ code.
Table of contents
About the author
Giovanni Dicanio is a computer programmer specialized in both cross-platform C and C++, and Windows operating system development. He is a Microsoft MVP for Visual C++. He also blogs on msmvps.com/gdicanio.
More Courses by Giovanni