Help us and donate little Bitcoins to pay the server costs: 1AXLPuRUBYc1JczTW4XS65GL6oWjNP2Vt2

User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer







because of the inhumane working conditions at amazon in Germany, I will offer the Amazon app no more! (ARD Reportage)
c:stdio.h:fputs

fputs

    int fputs(const char *str, FILE *stream); 

Writes str, to (output) stream stream. Returns non-negative on success or EOF on error.

C Sourcecode Example

/* 
 * fputs example code
 * http://code-reference.com/c/stdio.h/fputs 
 */
 
 
#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
 
int main( void )
{     
  FILE *stream;
 
  if((stream=fopen("test.txt","w"))==NULL) {
    printf("Cannot open file for writing.\n");
    return 1;
  }
 
  fputs("Test 1234", stream);
  fclose(stream);
 
  return 0;
}

fputs output example

  output: ./fputs

content of test.txt

Test 1234
advertising
c/stdio.h/fputs.txt · Last modified: 2013/01/22 22:02 (external edit)

The new Question & Answer System is online and waiting for your Questions about Programming problems http://ask.code-reference.com Impressum