Difference between revisions of "Intermediate C++ Game Programming Tutorial 4"
From Chilipedia
(Created page with "In this tutorial we tackle the idea file IO using basic input output functions. We also learn about the basic concept of a stream, learn the difference between binary mode and...") |
|||
Line 12: | Line 12: | ||
== Video Timestamp Index == | == Video Timestamp Index == | ||
[https://youtu.be/123412341234 Tutorial 4] | [https://youtu.be/123412341234 Tutorial 4] | ||
+ | |||
+ | == Code Repository == | ||
+ | [https://github.com/planetchili/intlo GitHub] | ||
== Homework == | == Homework == |
Revision as of 23:21, 5 June 2017
In this tutorial we tackle the idea file IO using basic input output functions. We also learn about the basic concept of a stream, learn the difference between binary mode and text mode, and Chili even sneaks in a dank Cypress Hill reference.
Topics Covered
- Opening a file with
std::ifstream
- Reading with
get()
and monitoring the steam state withgood()
- Detecting the EOF (End of File) as well as errors in reading and file opening
- Writing to files with
std::ofstream
- The working directory of the application (where it looks for files)
- The difference between binary mode and text mode
- Writing and reading blocks of bytes with
write()
andread()
Video Timestamp Index
Code Repository
Homework
Write a console application where the user can enter data pairs consisting of name:value in the form of c-string:unsigned int. Store they entries in memory, and allow the user to print out a text chart on demand. Also allow the user to save the entries to a file and load a file of entries into memory. You may not use any library functions beyond what is already being used in the Intermediate series.