write_one_by_one
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int write_one_by_one(char *filename, const char *text){
|
||||
|
||||
FILE *file = fopen(filename, "rw");
|
||||
FILE *file = fopen(filename, "w");
|
||||
if(!file) return 1;
|
||||
|
||||
|
||||
|
||||
int index = 0;
|
||||
while(*(text + index) != '\0'){
|
||||
fputc(*(text + index ), file);
|
||||
index ++;
|
||||
}
|
||||
//fputc(*text, file);
|
||||
fputc('\0', file);
|
||||
fclose(file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user