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;);
}
4.6
5
// 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;);
}
Thank you!
5
0
Are there any code examples left?
New code examples in category Assembly
-
Assembly 2022-03-27 17:40:42 create your own macro in assembly language
-
Assembly 2022-03-22 20:55:01 printf format specifiers c
-
Assembly 2022-03-20 06:00:11 how to listen for changes on an ObservableMap
-
Assembly 2022-03-11 19:40:11 vundle vim-javascript
-
Assembly 2022-03-01 07:30:06 restart kde
-
Assembly 2022-02-24 11:00:40 assembly print
-
Assembly 2022-02-16 02:15:03 vim shortcuts keyboard code
-
Assembly 2022-02-12 22:50:25 hello world x64 assembly
-
Assembly 2022-02-02 18:11:11 cout boolalpha