I have to call ping from C++ code. I'd like to easily read the output for further utilization.
I have come up with two solutions:
I'd like the latter, but I didn't find anything that was clearly a standard solution.
How would you do it?
I would go with your first option. Linux is built around the concept of having small, specialized apps which do one thing really well, communicating with pipes. Your app shouldn't include a library to implement ping, since there is already a built-in command to do it, and it works very well!