Nikita
0
Q:

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;);

}
0
// 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;);

}
0

New to Communities?

Join the community