[crayon-60941a7d905a0093791807/] Output : [crayon-60941a7d905aa792228462/] 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-60941a7d92550171945436/] 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-60941a7d928b6261052855/] 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-60941a7d928bd865662135/] Step 2 : Open Target File in Write Mode [crayon-60941a7d928c0287965790/] Step 3 : Read Source File Character by Character [crayon-60941a7d928c3750565844/] "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-60941a7d93049966009287/] Output : [crayon-60941a7d93050373897329/] Explanation : [crayon-60941a7d93053157762167/] __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-60941a7d93055710392132/] then [crayon-60941a7d93058119694639/] will be expanded as - [crayon-60941a7d9305b955359412/]