Answers for "fp = fopen("/tmp/test.txt", "w+");"

0

fp = fopen("/tmp/test.txt", "w+");

// C - Used to write into a file 

#include <stdio.h>

main()
{
   FILE *fp;

   fp = fopen("/tmp/test.txt", "w");
   fprintf(fp, "This is testing...\n");
   fclose(fp;);

}
Posted by: Guest on April-01-2020
0

fp = fopen("/tmp/test.txt", "w+");

// C - Used to write into a file line by line from user input

#include <stdio.h>

main()
{
   FILE *fp;
   char buffer[20];

   fp = fopen("/tmp/test.txt", "r");
   fscanf(fp, "%s", buffer);
   printf("Read Buffer: %s\n", %buffer );
   fclose(fp;);

}
Posted by: Guest on April-01-2020

Code answers related to "fp = fopen("/tmp/test.txt", "w+");"

Code answers related to "Assembly"

Browse Popular Code Answers by Language