[crayon-617571d1087be016744380/] Output : [crayon-617571d1087c8993378187/] Explanation :
We are reading one file character by character and same character is written in the other file which is opened in writing mode.
Read the single file character by character and change the case of character to uppercase and write the character to the file opened in write mode.
Compare two files in a C Programming Program : C Program to Compare two text/data files in C Programming Check whether two files are identical or not. [crayon-617571d109fdd445540016/] Explanation : Firstly Declare two file pointers for two files. Open two files in read mode. Now Inside while loop read both files character by character. Check both characters whether they are equal or not. If inside if statement ch1 = EOF and ch2=EOF then both files are said to be equal otherwise both files are non identicle.
Program : Copy Text From One File to Other File [crayon-617571d10a6df598028755/] Explanation : To copy a text from one file to another we have to follow following Steps : Step 1 : Open Source File in Read Mode [crayon-617571d10a6e6149082583/] Step 2 : Open Target File in Write Mode [crayon-617571d10a6e9654867612/] Step 3 : Read Source File Character by Character [crayon-617571d10a6ec219218432/] "fgetc" will read character from source file. Check whether character is "End Character of File" or not , if yes then Terminate Loop "putc" will write Single Character on File Pointed [...]
Program : [crayon-617571d10aacb435113334/] Output : [crayon-617571d10aad6597317681/] Explanation : [crayon-617571d10aad9616605002/] __FILE__ is Standard Predefined Macros in C Programming. This macro will expand to the name of current file path. Suppose we have saved this source code at path - [crayon-617571d10aadc095146242/] then [crayon-617571d10aadf497955255/] will be expanded as - [crayon-617571d10aae2288899191/]