So, I just got into 'C++' dev, and I am wondering how, exactly std::endl and \n differ. I looked it up, and I think endl flushes the buffer, which, I believe, means its no longer being temporarily stored in memory, and is now being printed out into a text file or a terminal. My question, though, is whether you can use \n for console applications too, which is printing onto a terminal, and it outputs the same. Is my interpretation of the buffer and flushing wrong? If so, what exactly does these mean?
EDIT: The question is mainly about how \n can behave the same way in the terminal if things are only outputted onto the terminal if they've been flushed.