Program to open a file in c++, C/C++ Programming

Assignment Help:

Program to Open a file in C++:

int main()

{

                 char ch;

                 ifstream f1 ("OLDFILE.TXT");

                 ofstream f2 ("NEWFILE.TXT");

 

                 if (!f1) cerr << "Cannot open OLDFILE.TXT for input";

                 if (!f2) cerr << "Cannot open NEWFILE.TXT for output";

 

                 while (f2 && f1.get(ch))

                                 f2.put(ch);

 

return 0;

 

}


Related Discussions:- Program to open a file in c++

Using substitution model write corresponding constructor, (a) Pairs may be ...

(a) Pairs may be represented using a lambda. Using only lambdas, create a procedure (triple x y z) that constructs a triplet. You may NOT use car, cons or cdr in the triplet proced

Pebble merchant, simple coding for pebble merchant..

simple coding for pebble merchant..

Socket Programming, Need someone to look over my assignment for correctness...

Need someone to look over my assignment for correctness and make any necessary changes.

Graphic.h, what is the syntax to get a coloured output.

what is the syntax to get a coloured output.

How to make a triangle number, i wont to make triangle with number but numb...

i wont to make triangle with number but number from the largest possible number to 01 (reversed).

Program of sorting algorithms , The program sorting.cpp contains a main f...

The program sorting.cpp contains a main function for testing the operation of several sort algorithms over various data sizes and data set organisations. The program understands

C++, write a C++ program that performs the following tasks 1. prompts the u...

write a C++ program that performs the following tasks 1. prompts the user to enter two numbers 2. displays the divisors of each number and store the divisors of number 1 in A and t

Random question, Ask question #write statement that assign random integer t...

Ask question #write statement that assign random integer to the varaible n in the (100

LOOP, DIFFERENCE BETWEEN WHILE AND DO WHILE LOOP?

DIFFERENCE BETWEEN WHILE AND DO WHILE LOOP?

Decodethecode, decode smugglers are very smart in day by day

decode smugglers are very smart in day by day

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd