2078 12

BIT153 ยท 2078 ยท 5 marks

Write a program that writes the contents of file 1 into file 2.

Write a program that writes the contents of file 1 into file 2. [5]

Object Oriented ProgrammingChapter 10: Exception Handling and File I/OText file reading and writing

--- Step Function Used Purpose ----------------------------- Open file1 fopen("file1.txt", "r") Opens file1 in read mode Open file2 fopen("file2.txt", "w") Opens file2 in write mode (creates if not exists) Read character fgetc(file1) Reads one character at a time from file1 Write character fputc(...