i use popen to get the output of this command:
tail -f /var/log/kern.log
I use a while loop and fgets (to get the output)
the process is running and will not stop. other process cannot run and others hang!
how to solve this?
i use popen to get the output of this command:
tail -f /var/log/kern.log
I use a while loop and fgets (to get the output)
the process is running and will not stop. other process cannot run and others hang!
how to solve this?
while( !feof( filePointer ) )
fgets(buff, 500, filePointer);
...Should work.
else you could do:
while(fgets(buff, 500, filePointer) != NULL)
//do something
..or simply:
while(fgets(buff, 500, filePointer) )
if that still doesn't work, be sure (A) the file is a text file, and (B) you opened it in text mode, ie: "r".
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }