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++

Program, write a program that adds all numbers from 1 to 200

write a program that adds all numbers from 1 to 200

Is probable to encompass virtual constructor? if yes, Is it probable to enc...

Is it probable to encompass Virtual Constructor? If yes, how? If not, Why?

Logical operators, how can i make a program with !(not) operator

how can i make a program with !(not) operator

Loop, Write a program that writes your name on the monitor ten times. Write...

Write a program that writes your name on the monitor ten times. Write this program three times, once with each looping method.

Square maze, SquareMaze The SquareMaze class should be declared and defined...

SquareMaze The SquareMaze class should be declared and defined in maze.h and maze.cpp, respectively. Each SquareMaze object will represent a randomly-generated square maze and its

Algorithme, algorithm to find whether a given number is prime number or not...

algorithm to find whether a given number is prime number or not? using pseudo code and flowchart

Board coloring, coloring of elements in matrix form inm particular matrix.t...

coloring of elements in matrix form inm particular matrix.the color should not match with another color.

Create a mathematical number guessing game, Create a mathematical number gu...

Create a mathematical number guessing game. Have the user prompt for the number of games that they want to play. Then each game consists of the following rules. a. The computer

Advanced features of c, We are now quite happy to use the basic mathematica...

We are now quite happy to use the basic mathematical expressions, however in engineering we use scientific functions i.e Sin , Cos  , ln etc . Within C we have the following functi

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