Program is to append the contents of one file to another, C/C++ Programming

Program is to append the contents of one file to another:

void main()

   {

  clrscr();

  fstream file1,file2;

  char st1[13],st2[13];/* 13 because a filename cannot have more than name

  of 8 charecters and 3 for extention and 1 for null value*/

  cout<<" input the source filename ";

  cin>>st1;

  cout<<" enter the target file name ";

  cin>>st2;

  file1.open(st1,ios::in);

  file2.open(st2,ios::out|ios::app);

  char ch;

  while(file1)

    {

    file1.get(ch);

    file2<

    }

  file1.close();

  file2.close();

   }

 

 

Posted Date: 10/19/2012 5:33:04 AM | Location : United States







Related Discussions:- Program is to append the contents of one file to another, Assignment Help, Ask Question on Program is to append the contents of one file to another, Get Answer, Expert's Help, Program is to append the contents of one file to another Discussions

Write discussion on Program is to append the contents of one file to another
Your posts are moderated
Related Questions
Q: How can Define an Array? An Array is defined in much the alike manner as ordinary variables except that every array name must be accompanied by a size specification (that is


Explain the Formatted Input Output with Strings? These are the third set of the scanf and printf families. They are called sscanf and sprintf. sprintf Puts formatted dat

A: you can exploit by overloading standard operators on a class, the intuition of the users of that class. This allow users program in the language of the problem domain instead of

C Program to check PRIME NUMBERS   main() {           int i,k,r,flag;           clrscr();           printf("ENTER THE NO. TO CHECK IT IS PRIME OR NOT: ");

The concept of a string in C is difficult, because a string is a collection of characters stored in memory terminated by a NULL string i.e. \0. Let us consider the string Hello. Th

# include stdio.h> # include conio.h> # include string.h> void main()   {           int i=0,j=0;           char a[100],temp;           clrscr();

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

The program will consist of two text fields, two buttons, and a counter label.  One text field will be input, where the user types the plain text.  The second text field will be ou

Program1: Write a program to find the factorial of a given number. The input is user given. Final output is printed out on to the screen. Program2: Write a program to gene