I have a project on ubuntu and C++ and somewhere in my code there is a loop that outputs lots of data to standard output (terminal). Among these data there is an error field that I want to see its evolution as the loop iterates. For sake of clarity, consider the code below:
while (error > epsilon) {
//do stuff
std::cout<<foo1<<std::endl;
std::cout<<foo2<<std::endl;
somehow send error to gnuplot!
//do the rest of the stuff
}
What I have in my mind is to print error to somewhere such as /dev/null
and try to gnuplot it. However I'm not sure if it's possible, how to do that if possible, but above all I'm not sure if this is the proper way of doing this.
How to such task in the correct way?