#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; }