|
Re: Adding program [message #1742689 is a reply to message #1742661] |
Tue, 06 September 2016 16:09 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
It worked for me but I think the problem is that the output stream (stdout) is buffered. It depends on your operating system and the library being used.
Try this at the beginning of your main
setvbuf(stdout, NULL, _IOLBF, 0);
This says to only buffer until an end of line is sent. Then the buffer is emptied.
There are other options. For example, _IONBF means no buffering.
More info: http://www.cplusplus.com/reference/cstdio/setvbuf/
Note this won't change std::iostream. There are different calls for that.
[Updated on: Tue, 06 September 2016 16:11] Report message to a moderator
|
|
|
|
|
Re: Adding program [message #1742711 is a reply to message #1742705] |
Tue, 06 September 2016 18:43 |
Tauno Voipio Messages: 742 Registered: August 2014 |
Senior Member |
|
|
I tried it on OS X 10.9.5, and it was sufficient to set the console allocation check in run configuration.
From a terminal (under Eclipse or stand-alone) it did run without any changes.
I do not know anything on the behaviour under any of the current Windowses, however.
For the other posts: There's one more here in CDT group and another in Newcomers.
--
-TV
--
Tauno Voipio
[Updated on: Tue, 06 September 2016 19:38] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04176 seconds