output is not displayed until the length of the buffer is reached (or output is flushed), see the answer here:
C: Why is a fprintf(stdout,....) so slow? - Stack Overflow[
^].
Quote:
1. How force to write at cout within the function?
I would maintain the line buffer policy. On the other hand, if you insist on using the full buffer one, then you have to explicitely flush
cout
.
Quote:
2. What happens if writting size is bigger than the buffer size?
The wonderful: on reaching buffer size, the buffer content is sent to the screen and the whole buffer is then available for further output.