Files
CSPP-coursework/final/log.c
T
2024-12-05 01:42:50 +00:00

19 lines
290 B
C

#include "dynstr.h"
int write_log(String_t* string) {
FILE* file = fopen("log.txt", "a");
int numlines;
String_t* lines = str_lines(string, &numlines);
for (int i = 0; i < numlines; i++) {
str_to_file(&lines[i], file);
}
fclose(file);
return 0;
}