I've create issue: https://github.com/kripken/emscripten/issues/2959
воскресенье, 26 октября 2014 г., 16:49:59 UTC+6 пользователь Anton Smirnov написал: > > Few topics ago i've asked similar question > <https://groups.google.com/forum/#!topic/emscripten-discuss/ilSnBNrd2kY> > and i was answered that printf needs '\n' or fflush() to force output. That > works great in Google chrome but unfortunately does not work in Safari > (which is default browser and widely used on mac). How can i force output > or workaround it (i agree it can be Safari's bug/feature though)? > > Full story: > > #include <iostream> > > > using namespace std; > > > int main() { > char name[128]; > cout << "type your name:\n"; > cin.getline(name, sizeof(name)); > cout << "hi, " << name << endl; > > > return 0; > } > > > In Safari input box is shown before "type your name" is printed: > > > <https://lh5.googleusercontent.com/-KT3eWAPE1ZE/VEzRNE6E86I/AAAAAAAABAA/qaBhNWD33jA/s1600/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%2B%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%2B2014-10-26%2B%D0%B2%2B16.43.18.png> > > I've try fflush(stdout) too, but unfortunately it does not help. > > After text input done cout works as expected: > > type your name: *(input dialog shown and 'Anton' is typed)* > > hi, Anton > > > > > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.