A
atlanta
i have this:
#include <ifstream>
#include <ofstream>
#include <assert.h>
using namespace std;
Void test_read_write ()
{
ifstream in_file ("infile.txt");
ofstream out_file ("outfile.txt");
assert (in_file.is_open () && out_file.is_open ());
char read_char;
while (!in_file.eof ())
{
in_file.get (read_char);
out_file << read_char;//or : out_file.put (read_char)
}
in_file.close (); //normally, fstream destructors
out_file.close ();//close opened files.
}
How do i adds the numbers?
This is what i have to do:
"opens a file & reads five numbers from that file, adds the numbers,
and prints a labeled result to another file only."
it have to successfully compiles on Visual C++ 6.
dont worry able the visual C++ 6. - i have that.
i just need the program.
help please,
(e-mail address removed)
#include <ifstream>
#include <ofstream>
#include <assert.h>
using namespace std;
Void test_read_write ()
{
ifstream in_file ("infile.txt");
ofstream out_file ("outfile.txt");
assert (in_file.is_open () && out_file.is_open ());
char read_char;
while (!in_file.eof ())
{
in_file.get (read_char);
out_file << read_char;//or : out_file.put (read_char)
}
in_file.close (); //normally, fstream destructors
out_file.close ();//close opened files.
}
How do i adds the numbers?
This is what i have to do:
"opens a file & reads five numbers from that file, adds the numbers,
and prints a labeled result to another file only."
it have to successfully compiles on Visual C++ 6.
dont worry able the visual C++ 6. - i have that.
i just need the program.
help please,
(e-mail address removed)