The output stream buffer stream should be sufficient. You can do it with
cout << "The script will be executed";
cout.flush();
Alternatively, if you plan to also print a newline, you can use std::endlone that implicitly clears the buffer:
cout << "The script will be executed" << endl;
source
share