Generating File Output and Input

Generating File Output and Input - CS 171 Introduction to C...

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

View Full Document Right Arrow Icon
CS 171: Introduction to C++ Programming for Engineers Spring 2011 Adapted from Prof. Rebecca Bates Generating File Output and File Input It is often useful to send output to a file. If you want to further process your data, saving it to a file allows you to use the data as input to another program. Writing to a file is similar to writing to a console. Here, we take advantage of some of the object oriented capabilities of C++ to direct our output to a particular location on a disk, either the computer's hard disk or to a floppy disk. First, you need to decide what the name of the output file is and where you want the file to exist. If you choose a name but do not choose a location, the computer will write the file in whatever location the program is running in. You might not want this. Name: lab2-output.txt Location: "c:" For now, we will put the file at the top of the c drive. You may decide to put it somewhere else. You will need to fully define the path of the location. CODE SETUP:
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.

This note was uploaded on 06/28/2011 for the course CS 171 taught by Professor Ravi during the Spring '11 term at Minnesota.

Page1 / 3

Generating File Output and Input - CS 171 Introduction to C...

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