what function would you use to write a line to a file?
If instead of printf("hello") to the terminal, how would I get that into a file? I can do character by character, but the basic tutorial and even this book (The C Book — The Preprocessor) don't seem to deal with lines.
I can use output>file in the command line since it's printed perfectly on the terminal, but I need a way for it to do it internally.
**also, when I do ./a.out output>file, the file is created with the correct text, but the terminal also throws a segmentation error, it doesn't affect anything but it seems out of place, any ideas about that?