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

C assignment , 1. Create text a file with the name "myemail" that has a sin...

1. Create text a file with the name "myemail" that has a single line in it, consisting of your email address. Something like "[email protected]" (or your hotmail or gm

Multiple constructor, Constructor public class ListNode {    //...

Constructor public class ListNode {    // package access members; List can access these directly private E data; // data for this node privateListNode nextNode; /

Dds, dsgdgdgdfgegwfesfsddfvxvwe

dsgdgdgdfgegwfesfsddfvxvwe

Array, write a function that take as parameters an array of integer and its...

write a function that take as parameters an array of integer and its size and return the sum of its value

Introduction to C language, Design and implement a library system that does...

Design and implement a library system that does the following: ? Takes details of a student/library users: first name, last name, other names, user ID number, and nationality. Th

C program, what will be the c program for ideal gas equation.

what will be the c program for ideal gas equation.

Describe run-time type identification, The ability to verify at run time th...

The ability to verify at run time the type of an object by using the typed operator or the dynamic_cast operator.

Define one's complement operator, Define One's Complement Operator? The...

Define One's Complement Operator? The one's complement operator, occasionally called the "bitwise NOT" or "bitwise complement" operator produces the bitwise one's complement of

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