-
October 16th, 2011, 10:54 PM
#1
if/of streams
Hello, im stuck writting this little program.
Code:
outdata.open("currentsales");
outdata << ????;
indata.open("projectedsales");
indata >> ???? * 2 >> endl;
indata.close();
outdata.close();
Im supposed to write the other statements necessary to read one integer from a file called currentsales and write twice its value into a file called projectedsales .
-
October 17th, 2011, 01:30 AM
#2
Re: if/of streams
Originally Posted by subzero06
Im supposed to write the other statements necessary to read one integer from a file called currentsales and write twice its value into a file called projectedsales .
Therefore, you need an input stream for the currentsales file and an output stream for the projectedsales file. Also, you need an integer variable to hold the input read, and with which you can compute the output to write.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|