Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

write to file in c programming

  [...]
  printf("Enter name: 
");
  if (fgets(name, sizeof name, stdin)) {
    fputs(name,fileptr);
    fclose(fileptr);
    printf("File write was successful
");
  } else {
    printf("Read error.
");
  }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #write #file #programming
ADD COMMENT
Topic
Name
5+9 =