C fputs

C fputs function is implemented in file related programs for writing string to any particular file.

Syntax:
int fputs(const char *str, FILE *stream)
Example:
void main(void)
{
    FILE* fileName;
    fileName = fopen("anything.txt", "w");
    fputs("Example: ", fileName);
    fclose(fileName);
}
  • In this function returns non-negative value, otherwise returns EOF on error.

Scroll Back to Top