C Language Archive
EOF: It is pre-defined constant variable. EOF is a macro(constant) Constant variables represent in capital letters(in all programming languages) EOF is assigned with value -1 EOF represents “End Of File” while processing file data.
fclose(): It is used to close the file after use. It is recommended to release every resource(file) after use. After working resource, releasing a resource is called Proper shut down. Improper shutdown causes loss of …
fputc(): A pre-defined function is used to write the data character by character into file. The prototype is : void fputc(int x, FILE* stream);
fseek(): It is used to move the cursor position in the opened file, to perform read and write operations. Prototype is : int fseek(FILE* steam, long offset, int origin); “offset” is a long type variable …
rewind(): Reset the cursor position to start of the file. Prototype is : void rewind(FILE* stream);
fgets(): It is used to read specified number of characters(String) at a time. Prototype is : char* fgets(char* str, int size, FILE* stream); It reads “size” bytes from specified “stream” and stores into “str”. On …
feof(): It used to test whether End of File has reached or not Prototype is: int feof(FILE* stream) It returns -1 when End Of File has reached. If not, it returns 0
rename(): It used to rename the specified file. Prototype is: int rename(char* old, char* new); On success, it returns 0 On failure, it returns -1 remove(): It used to rename the specified file. Prototype is: …
fprintf(): A pre-defined function belongs to stdio.h header file. A function is used to write set of characters into file. This function is used to write stream with specific format. printf() function write the data …
typedef: It is a keyword. It is user defined data type. It is used to create synonyms to existing data types. Typedef declarations are not permanent. Once the program execution completes, the synonyms will be …