DEV C With using of programing language of DEV C it is diffe

[DEV C++] With using of programing language of DEV C++, (it is different programming language other than normal C++.)

array1.txt is:

array2.txt is:

3. Given two arrays, we can append one array to the end of the other. For example: x1 x2 result 1.1 0.7 1.1 2.3 2.3 1.6 4.2 3.2 4.2 1.3 0.7 1.6 3.2 1.3 Write a program, appendarrays.c, which reads two arrays x1 and x2 from the files array1.txt and array2.txt, appends x2 to the end of x1, and then writes the result to the file appendarraysout.txt In more detail main carries out the following steps: opens the three files array1.txt, array2.txt, and appendarraysout.txt. reads the first array x1 from the file array1. txt. reads the second array x2 from the file array2.txt calls the function append, which appends x2 to the end of x1 resulting in a new array y. writes the size of y followed by the values of y to the file appendarraysout.txt

Solution

/* C++ Program - Merge Two Files */ #include #include #include #include #include void main() { clrscr(); ifstream ifiles1, ifiles2; ofstream ifilet; char ch, fname1[20], fname2[20], fname3[30]; cout<<\"Enter first file name (with extension like file1.txt) : \"; gets(fname1); cout<<\"Enter second file name (with extension like file2.txt) : \"; gets(fname2); cout<<\"Enter name of file (with extension like file3.txt) which will store the contents of the two files (fname1 and fname1) : \"; gets(fname3); ifiles1.open(fname1); ifiles2.open(fname2); if(ifiles1==NULL || ifiles2==NULL) { perror(\"Error Message \"); cout<<\"Press any key to exit...\ \"; getch(); exit(EXIT_FAILURE); } ifilet.open(fname3); if(!ifilet) { perror(\"Error Message \"); cout<<\"Press any key to exit...\ \"; getch(); exit(EXIT_FAILURE); } while(ifiles1.eof()==0) { ifiles1>>ch; ifilet<>ch; ifilet<
[DEV C++] With using of programing language of DEV C++, (it is different programming language other than normal C++.) array1.txt is: array2.txt is: 3. Given two

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site