lab3 - Lab 3 - File I/O In this lab, we are going to...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab 3 - File I/O In this lab, we are going to practice basic file input and output for C++. Syntax for what you need to accomplish will not be included for everything; you will need to refer to lecture 4 or other resources for syntax review. Part 0: Template File Create a file called template.cpp that has all the basic elements of a C++ source code file (the scaffolding). This file should compile but do nothing. You can use this to help you get started with most future programs that you write. Feel free to add to it as you want. Part 1: File Output Copy template.cpp to a new file, lab3part1.cpp. Below is a reminder of how to do this, remember you must be in the same folder as the file you want to copy (template.cpp). In order to do file input and output, you will need to include the library that works with file streams. This library is called "fstream" and you can include it as you normally include the iostream library. For this part of the lab, you will be learning how to do simple file output. Below is a skeleton for you to follow. We want you to output the message "The answer is 42, but what is the question?" , but feel free to change this. 1.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

lab3 - Lab 3 - File I/O In this lab, we are going to...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online