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
application problem of tower of hanoi


Explain a class to model a banking system. The function members should allow initializing the data members, a query to facilitate for account and a facility to deposit and with

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

i need amibroker afl to dll plugin

Although we can handle most I/O routines with getc and putc , there are file versions of fgets, fputs, fprintf and fscanf . The syntax is       fgets(stringname,n,filename);   Th

Project Description: I have software written with VB that i helped design, but now the original author died,(Neil Tromp), and the software ended up in the hands of someone else!

Logical Operators We say any expression that evaluates to zero is a FALSE logic condition and that evaluating to non-zero value is a TRUE condition. Logical operators are usefu

Friend for Overloading Operators Sometimes friend functions cannot be avoided. For example with the operator overloading. Consider the following class that have data members to

a padovan string p(n) for a natural number n is defined as p(0)=''x'' p(1)=''y'' p(2)=''z'' p(n)=p(n-2)+p(n-3),n>2