fopen is used to open a file for read, write or update. stdin, stdout & stderr are opened by the system at execution time.
Library: stdio.h Prototype: FILE *fopen(const char *filename, const char *mode); Syntax: FILE *fp; fp = fopen( "/etc/printcap", "r");
filename - is the name of the file. mode - r - read file. - w - Write to file. - a - Append to file.