Question: Problem deals with C++. How do you close an istream pointer or just delete the pointer (near the top of read function). I'm having file3

Problem deals with C++.

How do you close an istream pointer or just delete the pointer (near the top of read function).

I'm having file3 overwritten with file3, file2, and file1 contents. file2 is overwritten with file2 and file1 contents. Hence, I'm assuming its something to do with my istream pointer. Here is the compile arguments $ ./hw 90 file1 file2 file3

Problem deals with C++. How do you close an istream pointer or

This is so you can visualize what I'm trying to accomplish

just delete the pointer (near the top of read function). I'm having

This happens. It's adding the previous file(s) content to the forward file. Its suppose to read from the file, rotate its content by 90 degrees and then write back to that file.

I added "delete in" hoping that would fix it but it came up with all sorts of errors mostly with malloc: *** error for object pointer freed was not allocated and such.

* reads data from text file and pushes it to vector * @param empty 2D vector * @param filename (argv[i] from for-loop) void read (vector >& out, string filename) // read from file ifstream textfile; // used for standard input or from file istream in; if (filename.empty)) // read from standard input ./hw 0 >& out, string filename) ofstream, outfile; outfile.open(filename) for(size ti-; i v; string degrees argv [1]; if(argc 2) read (v, ""); print (v) /I Assume this function works else if (argc > 2) for(int i-2: i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!