Chapter 12: File IO and Command-Line Arguments


This chapter brings an element of completeness to our exploration of C++. Specifically, it extends the functionality of our applications to a level beyond simply storing variables in volatile system memory. It reaches further and examines how data is loaded to and from files stored on persistent disk storage such as hard disks. It explores how it is possible to save data in applications to a file so it may be used on later occasions. This is important for games because there will be many times when players will want to save and load their progress from session to session. In addition to file saving and loading, the issue of command-line arguments is also considered. This chapter examines the following subjects:

  • Files and iostream

  • Read and Write

  • Get pointer

  • Command-line arguments

Introduction to Game Programming with C++
Introduction to Game Programming with C++ (Wordware Game Developers Library)
ISBN: 1598220322
EAN: 2147483647
Year: 2007
Pages: 225
Authors: Alan Thorn © 2008-2017.
If you may any questions please contact us: