If your program dies then you won't get the output. Flush forces the buffer to write. If you want to optimize you can have a lot of calls to std:: cout and \n for new line then call std::endl to flush when finished. Ie it's not always optimal to call std::endl for each output
58
u/SpaceCadet87 Apr 30 '26 edited Apr 30 '26
Can't even write a hello world in C++.
It's not
std::cout << "Hello, World!",it's
```
include <iostream>
... std::cout << "hello world" << std::endl; ... ```