In programming, we may require some specific input data to be generated several numbers of times. Sometimes, it is not enough to only display the data on the console. The data to be displayed may be very large, and only a limited amount of data can be displayed on the console, and since the memory is volatile, it is impossible to recover the programmatically generated data again and again. However, if we need to do so, we may store it onto the local file system which is volatile and can be accessed every time. Here, comes the need of file handling in C. File handling in C enables us to create, update, read, and delete the files stored on the local file system through our C program. Writing File:- #include <stdio.h> main(){ FILE *fp; fp = fopen("file.txt", "w");//opening file fprintf(fp, "Hello file by fprintf...\n");//writing data into file fclose(fp);//closing file } Reading File:- #include <stdio.h> main(){ F
Find the Solutions for your day to day Code Challenges