The fputs function writes a string to a file stream and is declared in stdio.h, which contains standard input/output functions. This header includes file operations like fputs, fgets, fprintf, and fscanf. stdlib.h is for general utilities, process.h for process control, and dos.h for DOS-specific functions.