|
Re: Console debuging [message #1715650 is a reply to message #1715491] |
Wed, 25 November 2015 02:52 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
Your question is not clear but you seem to be asking how to see the output as it occurs.
This generally requires you to set either line buffer mode or unbuffered mode.
My preference is line buffered mode which buffers the output until a newline is transmitted.
To do this:
#include <stdio.h>
setvbuf(stdout, NULL, _IOLBF, 256);
Or fully unbuffered: where each character is output when sent:
#include <stdio.h>
setvbuf(stdout, NULL, _IONBF, 0);
Or you could flush the buffer occasionally using fflush(stdout);
The above are for FILE* objects like stdout. There is a similar function for c++ i/o streams .
see: std::streambuf::pubsetbuf
http://www.cplusplus.com/reference/streambuf/streambuf/pubsetbuf/
[Updated on: Wed, 25 November 2015 03:03] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.01856 seconds