Well if your array already contains newlines (as if you had read the whole file into memory in one go), then look at either write() or fwrite()
[tt]ssize_t write(int fd, const void *buf, size_t count);
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
[/tt]
--