int sync();
true). Then (if good), it calls pubsync on its associated stream buffer object (if rdbuf is null, the function returns -1 instead). Finally, it destroys the sentry object before returning.-1), the function sets the badbit flag, and returns -1. Otherwise it returns zero, indicating success.-1.| flag | error |
|---|---|
| eofbit | - |
| failbit | The construction of sentry failed (such as when the stream state was not good before the call). |
| badbit | Either the internal call to pubsync returned -1, or some other error occurred on the stream (such as when the function catches an exception thrown by an internal operation).When set, the integrity of the stream may have been affected. |
|
|
Please, enter a word: test Please enter another word: text The first word began by t The second word began by t |